From 3c284fb2837bdcf0fd360ba051f9d36cafe553b7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Nov 2025 07:51:29 +0000 Subject: [PATCH 1/8] Initial plan From 2d1283b4708f3c6db4b959b06b2f2f68d33896af Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Nov 2025 07:57:00 +0000 Subject: [PATCH 2/8] Update dependencies to PHP 7.4+ and Symfony 5.4 Co-authored-by: rushi <65708+rushi@users.noreply.github.com> --- .travis.yml | 10 +++++----- DependencyInjection/Configuration.php | 4 ++-- README.md | 21 ++++++++++++++++++--- Resources/config/services.yml | 11 +++++------ Service/Omnipay.php | 4 ++-- composer.json | 13 ++++++++----- phpunit.xml.dist | 5 +++-- 7 files changed, 43 insertions(+), 25 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9fe794e..27a8949 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,14 @@ language: php php: - - 7.2 - - 7.3 - 7.4 + - 8.0 + - 8.1 + - 8.2 env: - - SYMFONY_VERSION="3.4" - - SYMFONY_VERSION="4.0" - - SYMFONY_VERSION="4.4" + - SYMFONY_VERSION="5.4" + - SYMFONY_VERSION="6.0" before_script: - composer self-update diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index fd1aa02..12dd881 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -16,8 +16,8 @@ class Configuration implements ConfigurationInterface */ public function getConfigTreeBuilder() { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('omnipay'); + $treeBuilder = new TreeBuilder('omnipay'); + $rootNode = $treeBuilder->getRootNode(); $rootNode->children() ->arrayNode('log') ->addDefaultsIfNotSet() diff --git a/README.md b/README.md index 5996a47..2039fed 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,14 @@ Xola OmnipayBundle [![Build status...](https://secure.travis-ci.org/xola/OmnipayBundle.png)](http://travis-ci.org/xola/OmnipayBundle) ================== This bundle integrates the [Omnipay payment processing library](https://github.com/adrianmacneil/omnipay) into -[Symfony2](http://symfony.com/). +[Symfony](http://symfony.com/). -This bundle supports Omnipay 3 +This bundle supports Omnipay 3 and requires PHP 7.4+ and Symfony 5.4+. + +Requirements +------------ +- PHP 7.4 or higher +- Symfony 5.4 or higher Installation ------------ @@ -17,8 +22,18 @@ To install via [Composer](http://getcomposer.org/), add the following to your `c } ``` -Add the bundle to your application kernel. +Add the bundle to your application kernel (Symfony 4+: this is done automatically via Symfony Flex). + +```php +// config/bundles.php (Symfony 4+) +return [ + // ... + Xola\OmnipayBundle\OmnipayBundle::class => ['all' => true], + // ... +]; +``` +For older Symfony versions: ```php // app/AppKernel.php public function registerBundles() diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 3c8c43e..6d31a41 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -1,9 +1,8 @@ -parameters: - omnipay.service.class: Xola\OmnipayBundle\Service\Omnipay - services: omnipay: - class: "%omnipay.service.class%" - arguments: [ "@service_container", "@logger" ] + class: Xola\OmnipayBundle\Service\Omnipay + arguments: + - '@service_container' + - '@logger' tags: - - { name: monolog.logger, channel: omnipay } + - { name: monolog.logger, channel: omnipay } diff --git a/Service/Omnipay.php b/Service/Omnipay.php index 3c516a6..555c840 100644 --- a/Service/Omnipay.php +++ b/Service/Omnipay.php @@ -11,7 +11,7 @@ use Omnipay\Common\Http\Client; use Psr\Log\LoggerInterface; use RuntimeException; -use Symfony\Component\DependencyInjection\Container; +use Symfony\Component\DependencyInjection\ContainerInterface; class Omnipay { @@ -20,7 +20,7 @@ class Omnipay protected $logger; private $container; - public function __construct(Container $container, LoggerInterface $logger) + public function __construct(ContainerInterface $container, LoggerInterface $logger) { $this->container = $container; $this->initConfig($container->getParameterBag()->all()); diff --git a/composer.json b/composer.json index b9ef661..c91d1af 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "xola/omnipay-bundle", "type": "symfony-bundle", - "description": "Integrates Omnipay 3 with Symfony 2+", + "description": "Integrates Omnipay 3 with Symfony 5.4+", "keywords": [ "omnipay", "payment", @@ -12,13 +12,16 @@ "homepage": "https://github.com/xola/OmnipayBundle", "license": "MIT", "require": { - "php": ">=7", - "symfony/framework-bundle": ">=2.1", + "php": "^7.4 || ^8.0", + "symfony/framework-bundle": "^5.4", + "symfony/dependency-injection": "^5.4", + "symfony/config": "^5.4", + "symfony/http-kernel": "^5.4", "league/omnipay": "^3.0", "php-http/logger-plugin": "^1.1" }, "require-dev": { - "phpunit/phpunit": "^6", + "phpunit/phpunit": "^9.5", "omnipay/authorizenet": "^3.3", "omnipay/eway": "^3.0", "omnipay/mollie": "^5.2", @@ -28,7 +31,7 @@ "omnipay/securepay": "^3.0", "omnipay/stripe": "^3.1", "omnipay/worldpay": "^3.0", - "symfony/yaml": "^3.4" + "symfony/yaml": "^5.4" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d0be232..f41c80f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,13 +1,14 @@ - From 413fa53fa2387b188d849d7d38c006e34050bd96 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Nov 2025 08:04:10 +0000 Subject: [PATCH 3/8] Add PHPUnit result cache to .gitignore Co-authored-by: rushi <65708+rushi@users.noreply.github.com> --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 24c7d96..c5a8d84 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ composer.lock composer.phar phpunit.xml +.phpunit.result.cache From 3c41137c882ae3402121e12cf274bcd5b48f9ef6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Nov 2025 08:06:02 +0000 Subject: [PATCH 4/8] Revert to Container type hint for compatibility Co-authored-by: rushi <65708+rushi@users.noreply.github.com> --- Service/Omnipay.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Service/Omnipay.php b/Service/Omnipay.php index 555c840..3c516a6 100644 --- a/Service/Omnipay.php +++ b/Service/Omnipay.php @@ -11,7 +11,7 @@ use Omnipay\Common\Http\Client; use Psr\Log\LoggerInterface; use RuntimeException; -use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Container; class Omnipay { @@ -20,7 +20,7 @@ class Omnipay protected $logger; private $container; - public function __construct(ContainerInterface $container, LoggerInterface $logger) + public function __construct(Container $container, LoggerInterface $logger) { $this->container = $container; $this->initConfig($container->getParameterBag()->all()); From f1d8165c23b85abbf39953133d6bd7890251bbb2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Nov 2025 08:23:59 +0000 Subject: [PATCH 5/8] Add support for Symfony 4.4 alongside 5.4 Co-authored-by: rushi <65708+rushi@users.noreply.github.com> --- .travis.yml | 1 + README.md | 4 ++-- composer.json | 12 ++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 27a8949..4ea0771 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ php: - 8.2 env: + - SYMFONY_VERSION="4.4" - SYMFONY_VERSION="5.4" - SYMFONY_VERSION="6.0" diff --git a/README.md b/README.md index 2039fed..8db4505 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,12 @@ Xola OmnipayBundle [![Build status...](https://secure.travis-ci.org/xola/Omnipay This bundle integrates the [Omnipay payment processing library](https://github.com/adrianmacneil/omnipay) into [Symfony](http://symfony.com/). -This bundle supports Omnipay 3 and requires PHP 7.4+ and Symfony 5.4+. +This bundle supports Omnipay 3 and requires PHP 7.4+ and Symfony 4.4+. Requirements ------------ - PHP 7.4 or higher -- Symfony 5.4 or higher +- Symfony 4.4 or higher Installation ------------ diff --git a/composer.json b/composer.json index c91d1af..8f9bfb5 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "xola/omnipay-bundle", "type": "symfony-bundle", - "description": "Integrates Omnipay 3 with Symfony 5.4+", + "description": "Integrates Omnipay 3 with Symfony 4.4+ and 5.4+", "keywords": [ "omnipay", "payment", @@ -13,10 +13,10 @@ "license": "MIT", "require": { "php": "^7.4 || ^8.0", - "symfony/framework-bundle": "^5.4", - "symfony/dependency-injection": "^5.4", - "symfony/config": "^5.4", - "symfony/http-kernel": "^5.4", + "symfony/framework-bundle": "^4.4 || ^5.4", + "symfony/dependency-injection": "^4.4 || ^5.4", + "symfony/config": "^4.4 || ^5.4", + "symfony/http-kernel": "^4.4 || ^5.4", "league/omnipay": "^3.0", "php-http/logger-plugin": "^1.1" }, @@ -31,7 +31,7 @@ "omnipay/securepay": "^3.0", "omnipay/stripe": "^3.1", "omnipay/worldpay": "^3.0", - "symfony/yaml": "^5.4" + "symfony/yaml": "^4.4 || ^5.4" }, "autoload": { "psr-4": { From bf700dd4824a0114afd7802496cd47387f918135 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Nov 2025 08:39:11 +0000 Subject: [PATCH 6/8] Replace Travis CI with GitHub Actions (PHP 7.4 only) Co-authored-by: rushi <65708+rushi@users.noreply.github.com> --- .github/workflows/ci.yml | 51 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 20 ---------------- README.md | 2 +- 3 files changed, 52 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b027ff1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: CI + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + symfony-version: ['4.4', '5.4', '6.0'] + + name: PHP 7.4 - Symfony ${{ matrix.symfony-version }} + + steps: + - uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + extensions: mbstring, xml, ctype, iconv + coverage: none + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Get composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install dependencies + run: | + composer self-update + composer --version + composer require symfony/framework-bundle:${{ matrix.symfony-version }} --no-update + composer install --no-interaction --prefer-dist + + - name: Run test suite + run: vendor/bin/phpunit --configuration phpunit.xml.dist diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4ea0771..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: php - -php: - - 7.4 - - 8.0 - - 8.1 - - 8.2 - -env: - - SYMFONY_VERSION="4.4" - - SYMFONY_VERSION="5.4" - - SYMFONY_VERSION="6.0" - -before_script: - - composer self-update - - composer --version - - composer require symfony/framework-bundle:${SYMFONY_VERSION} --no-update - - composer install -n --prefer-source - -script: phpunit --coverage-text --configuration phpunit.xml.dist diff --git a/README.md b/README.md index 8db4505..508b970 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Xola OmnipayBundle [![Build status...](https://secure.travis-ci.org/xola/OmnipayBundle.png)](http://travis-ci.org/xola/OmnipayBundle) +Xola OmnipayBundle [![CI](https://github.com/xola/OmnipayBundle/workflows/CI/badge.svg)](https://github.com/xola/OmnipayBundle/actions) ================== This bundle integrates the [Omnipay payment processing library](https://github.com/adrianmacneil/omnipay) into [Symfony](http://symfony.com/). From 74a0a67e41c53139e371963665a4e22ad5f81254 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Nov 2025 08:40:56 +0000 Subject: [PATCH 7/8] Remove Symfony 6.0 from CI matrix to match composer.json Co-authored-by: rushi <65708+rushi@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b027ff1..36977c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - symfony-version: ['4.4', '5.4', '6.0'] + symfony-version: ['4.4', '5.4'] name: PHP 7.4 - Symfony ${{ matrix.symfony-version }} From 7e256b315ec3883ee06daed089a9790d4c05c7e8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Nov 2025 08:42:07 +0000 Subject: [PATCH 8/8] Add explicit permissions to GitHub Actions workflow Co-authored-by: rushi <65708+rushi@users.noreply.github.com> --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36977c0..856cde6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,9 @@ jobs: test: runs-on: ubuntu-latest + permissions: + contents: read + strategy: matrix: symfony-version: ['4.4', '5.4']