From 78de04bde8f8c945271bf095ced1c0334df1c7a0 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 29 Dec 2025 12:06:16 +0100 Subject: [PATCH 1/8] Convert XML to YAML service config --- Command/BuildCommand.php | 2 +- DependencyInjection/MassiveBuildExtension.php | 4 ++-- Resources/config/services.xml | 22 ------------------- Resources/config/services.yaml | 14 ++++++++++++ 4 files changed, 17 insertions(+), 25 deletions(-) delete mode 100644 Resources/config/services.xml create mode 100644 Resources/config/services.yaml diff --git a/Command/BuildCommand.php b/Command/BuildCommand.php index 2fdd500..7edeab5 100644 --- a/Command/BuildCommand.php +++ b/Command/BuildCommand.php @@ -62,7 +62,7 @@ public function __construct(BuildRegistry $buildRegistry, ContainerInterface $co $this->question = new QuestionHelper(); } - public function configure() + public function configure(): void { $this->setName('massive:build'); $this->setDescription('Execute build or build targets'); diff --git a/DependencyInjection/MassiveBuildExtension.php b/DependencyInjection/MassiveBuildExtension.php index e22eac6..9025007 100644 --- a/DependencyInjection/MassiveBuildExtension.php +++ b/DependencyInjection/MassiveBuildExtension.php @@ -34,8 +34,8 @@ public function load(array $configs, ContainerBuilder $container): void $config = $this->processConfiguration($configuration, $configs); $container->setParameter('massive_build.command.build.class', $config['command_class']); - $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); - $loader->load('services.xml'); + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); + $loader->load('services.yaml'); foreach ($config['targets'] as $target => $config) { $dependencies = \array_keys($config['dependencies']); diff --git a/Resources/config/services.xml b/Resources/config/services.xml deleted file mode 100644 index ede2a16..0000000 --- a/Resources/config/services.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - Massive\Bundle\BuildBundle\Build\BuildRegistry - - - - - - - - - - - - - - diff --git a/Resources/config/services.yaml b/Resources/config/services.yaml new file mode 100644 index 0000000..2564ae4 --- /dev/null +++ b/Resources/config/services.yaml @@ -0,0 +1,14 @@ +parameters: + massive_build.build.registry.class: Massive\Bundle\BuildBundle\Build\BuildRegistry + +services: + massive_build.build.registry: + class: '%massive_build.build.registry.class%' + + massive_build.command.build: + class: '%massive_build.command.build.class%' + arguments: + - '@massive_build.build.registry' + - '@service_container' + tags: + - { name: 'console.command' } From cf178586fa573de40fcdc1cb540204bd8515ee77 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 29 Dec 2025 12:08:45 +0100 Subject: [PATCH 2/8] Add support for Symfony 8 --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 815c526..9e93366 100644 --- a/composer.json +++ b/composer.json @@ -11,14 +11,14 @@ "license": "MIT", "require": { "php": ">=7.2.0", - "symfony/console": "^4.3 || ^5.0 || ^6.0 || ^7.0", - "symfony/config": "^4.3 || ^5.0 || ^6.0 || ^7.0", - "symfony/dependency-injection": "^4.3 || ^5.0 || ^6.0 || ^7.0", - "symfony/framework-bundle": "^4.3 || ^5.0 || ^6.0 || ^7.0" + "symfony/console": "^4.3 || ^5.0 || ^6.0 || ^7.0 || ^8.0", + "symfony/config": "^4.3 || ^5.0 || ^6.0 || ^7.0 || ^8.0", + "symfony/dependency-injection": "^4.3 || ^5.0 || ^6.0 || ^7.0 || ^8.0", + "symfony/framework-bundle": "^4.3 || ^5.0 || ^6.0 || ^7.0 || ^8.0" }, "require-dev": { "phpunit/phpunit": "^8.5", - "matthiasnoback/symfony-dependency-injection-test": "^4.0 || ^5.0", + "matthiasnoback/symfony-dependency-injection-test": "^4.0 || ^5.0 || ^6.0", "phpspec/prophecy": "^1.14" }, "autoload": { From ccf124a7ef57bf94360ef2d27402bdfa8bdf480a Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 29 Dec 2025 12:16:35 +0100 Subject: [PATCH 3/8] Update PHPUnit --- Tests/Console/MassiveOutputFormatterTest.php | 4 ++-- composer.json | 5 +++-- phpunit.xml.dist | 23 +++++++++++--------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Tests/Console/MassiveOutputFormatterTest.php b/Tests/Console/MassiveOutputFormatterTest.php index 521f118..560cf8a 100644 --- a/Tests/Console/MassiveOutputFormatterTest.php +++ b/Tests/Console/MassiveOutputFormatterTest.php @@ -31,7 +31,7 @@ public function testThatOutputWillBeDecorated($message, $indent, $expected) $this->assertEquals($expected, $result); } - public function getDecorationDataProvider() + public static function getDecorationDataProvider() { return [ ['Some string', 0, 'Some string'], @@ -54,7 +54,7 @@ public function testThatOutputWillNotBeDecorated($message, $indent) $this->assertEquals($message, $result); } - public function getNonDecorationDataProvider() + public static function getNonDecorationDataProvider() { return [ ['Some string', 0], diff --git a/composer.json b/composer.json index 9e93366..8aa762d 100644 --- a/composer.json +++ b/composer.json @@ -17,9 +17,10 @@ "symfony/framework-bundle": "^4.3 || ^5.0 || ^6.0 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^8.5", + "phpunit/phpunit": "^9.5 || ^10.0 || ^11.0", "matthiasnoback/symfony-dependency-injection-test": "^4.0 || ^5.0 || ^6.0", - "phpspec/prophecy": "^1.14" + "phpspec/prophecy": "^1.14", + "phpspec/prophecy-phpunit": "^1.1 || ^2.4" }, "autoload": { "psr-4": {"Massive\\Bundle\\BuildBundle\\": "."}, diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 3133ffb..3954016 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,17 +1,20 @@ - + - - ./Tests + + Tests - - - - ./ - - - + + + . + + From d438625a5cea4b70a4ce4342f27b512dcc142349 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 29 Dec 2025 12:17:20 +0100 Subject: [PATCH 4/8] Support PHPUnit 9 and newer --- Tests/Build/BuildRegistryTest.php | 2 +- Tests/Build/BuilderContextTest.php | 2 +- Tests/Command/BuildCommandTest.php | 2 +- Tests/ProphecyTrait.php | 23 ----------------------- 4 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 Tests/ProphecyTrait.php diff --git a/Tests/Build/BuildRegistryTest.php b/Tests/Build/BuildRegistryTest.php index 938a5c2..274ca74 100644 --- a/Tests/Build/BuildRegistryTest.php +++ b/Tests/Build/BuildRegistryTest.php @@ -14,7 +14,7 @@ use Massive\Bundle\BuildBundle\Build\BuilderInterface; use Massive\Bundle\BuildBundle\Build\BuildRegistry; use Massive\Bundle\BuildBundle\Tests\BaseTestCase; -use Massive\Bundle\BuildBundle\Tests\ProphecyTrait; +use Prophecy\PhpUnit\ProphecyTrait; class BuildRegistryTest extends BaseTestCase { diff --git a/Tests/Build/BuilderContextTest.php b/Tests/Build/BuilderContextTest.php index bd65bd3..1d19953 100644 --- a/Tests/Build/BuilderContextTest.php +++ b/Tests/Build/BuilderContextTest.php @@ -13,7 +13,7 @@ use Massive\Bundle\BuildBundle\Build\BuilderContext; use Massive\Bundle\BuildBundle\Tests\BaseTestCase; -use Massive\Bundle\BuildBundle\Tests\ProphecyTrait; +use Prophecy\PhpUnit\ProphecyTrait; class BuilderContextTest extends BaseTestCase { diff --git a/Tests/Command/BuildCommandTest.php b/Tests/Command/BuildCommandTest.php index 450dd3b..5ed2fc3 100644 --- a/Tests/Command/BuildCommandTest.php +++ b/Tests/Command/BuildCommandTest.php @@ -15,8 +15,8 @@ use Massive\Bundle\BuildBundle\Command\BuildCommand; use Massive\Bundle\BuildBundle\ContainerAwareInterface; use Massive\Bundle\BuildBundle\Tests\BaseTestCase; -use Massive\Bundle\BuildBundle\Tests\ProphecyTrait; use Prophecy\Argument; +use Prophecy\PhpUnit\ProphecyTrait; use Symfony\Component\Console\Tester\CommandTester; class BuildCommandTest extends BaseTestCase diff --git a/Tests/ProphecyTrait.php b/Tests/ProphecyTrait.php deleted file mode 100644 index 24b1255..0000000 --- a/Tests/ProphecyTrait.php +++ /dev/null @@ -1,23 +0,0 @@ - Date: Mon, 29 Dec 2025 12:28:36 +0100 Subject: [PATCH 5/8] Drop support for PHP < 8.2 --- .github/workflows/test-application.yaml | 24 ++++++------------------ composer.json | 16 ++++++++-------- 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/.github/workflows/test-application.yaml b/.github/workflows/test-application.yaml index eab3c3d..2acd55d 100644 --- a/.github/workflows/test-application.yaml +++ b/.github/workflows/test-application.yaml @@ -16,22 +16,10 @@ jobs: fail-fast: false matrix: include: - - php-version: '7.2' + - php-version: '8.2' dependency-versions: 'lowest' tools: 'composer:v2' - - php-version: '7.4' - dependency-versions: 'highest' - tools: 'composer:v2' - - - php-version: '8.0' - dependency-versions: 'highest' - tools: 'composer:v2' - - - php-version: '8.1' - dependency-versions: 'highest' - tools: 'composer:v2' - - php-version: '8.2' dependency-versions: 'highest' tools: 'composer:v2' @@ -51,7 +39,7 @@ jobs: steps: - name: Checkout project - uses: actions/checkout@v2 + uses: actions/checkout@v6 - name: Install and configure PHP uses: shivammathur/setup-php@v2 @@ -64,7 +52,7 @@ jobs: run: composer config minimum-stability ${{ matrix.composer-stability }} - name: Install composer dependencies - uses: ramsey/composer-install@v1 + uses: ramsey/composer-install@v3 with: dependency-versions: ${{matrix.dependency-versions}} @@ -77,16 +65,16 @@ jobs: steps: - name: Checkout project - uses: actions/checkout@v2 + uses: actions/checkout@v6 - name: Install and configure PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: 8.4 tools: 'composer:v2' - name: Install composer dependencies - uses: ramsey/composer-install@v1 + uses: ramsey/composer-install@v3 with: dependency-versions: 'highest' diff --git a/composer.json b/composer.json index 8aa762d..97ac368 100644 --- a/composer.json +++ b/composer.json @@ -10,17 +10,17 @@ ], "license": "MIT", "require": { - "php": ">=7.2.0", - "symfony/console": "^4.3 || ^5.0 || ^6.0 || ^7.0 || ^8.0", - "symfony/config": "^4.3 || ^5.0 || ^6.0 || ^7.0 || ^8.0", - "symfony/dependency-injection": "^4.3 || ^5.0 || ^6.0 || ^7.0 || ^8.0", - "symfony/framework-bundle": "^4.3 || ^5.0 || ^6.0 || ^7.0 || ^8.0" + "php": ">=8.2", + "symfony/console": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/config": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^9.5 || ^10.0 || ^11.0", - "matthiasnoback/symfony-dependency-injection-test": "^4.0 || ^5.0 || ^6.0", + "phpunit/phpunit": "^9.6 || ^10.0 || ^11.0", + "matthiasnoback/symfony-dependency-injection-test": "^5.1 || ^6.0", "phpspec/prophecy": "^1.14", - "phpspec/prophecy-phpunit": "^1.1 || ^2.4" + "phpspec/prophecy-phpunit": "^2.0" }, "autoload": { "psr-4": {"Massive\\Bundle\\BuildBundle\\": "."}, From e6936601d7163e6c700502a066728fddc0e1c357 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 29 Dec 2025 12:31:25 +0100 Subject: [PATCH 6/8] Increase PHPUnit version to 12 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 97ac368..c373484 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^9.6 || ^10.0 || ^11.0", + "phpunit/phpunit": "^9.6 || ^10.0 || ^11.0 || ^12.0", "matthiasnoback/symfony-dependency-injection-test": "^5.1 || ^6.0", "phpspec/prophecy": "^1.14", "phpspec/prophecy-phpunit": "^2.0" From 4ed7bd3bd2c7bb669e91bf81eac2eafecadee6b9 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 29 Dec 2025 12:34:46 +0100 Subject: [PATCH 7/8] Fix data provider --- Tests/Console/MassiveOutputFormatterTest.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Tests/Console/MassiveOutputFormatterTest.php b/Tests/Console/MassiveOutputFormatterTest.php index 560cf8a..ff02ce2 100644 --- a/Tests/Console/MassiveOutputFormatterTest.php +++ b/Tests/Console/MassiveOutputFormatterTest.php @@ -13,6 +13,7 @@ use Massive\Bundle\BuildBundle\Console\MassiveOutputFormatter; use Massive\Bundle\BuildBundle\Tests\BaseTestCase; +use PHPUnit\Framework\Attributes\DataProvider; class MassiveOutputFormatterTest extends BaseTestCase { @@ -23,6 +24,7 @@ class MassiveOutputFormatterTest extends BaseTestCase * * @dataProvider getDecorationDataProvider */ + #[DataProvider('getDecorationDataProvider')] public function testThatOutputWillBeDecorated($message, $indent, $expected) { $formatter = new MassiveOutputFormatter(true); @@ -33,11 +35,9 @@ public function testThatOutputWillBeDecorated($message, $indent, $expected) public static function getDecorationDataProvider() { - return [ - ['Some string', 0, 'Some string'], - ['Some string', 1, ' Some string'], - ['Some string', 2, ' Some string'], - ]; + yield ['Some string', 0, 'Some string']; + yield ['Some string', 1, ' Some string']; + yield ['Some string', 2, ' Some string']; } /** @@ -46,6 +46,7 @@ public static function getDecorationDataProvider() * * @dataProvider getNonDecorationDataProvider */ + #[DataProvider('getNonDecorationDataProvider')] public function testThatOutputWillNotBeDecorated($message, $indent) { $formatter = new MassiveOutputFormatter(false); From 73973ce0ed09ccc60245ec668b67adf441c859f5 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 29 Dec 2025 12:37:23 +0100 Subject: [PATCH 8/8] Drop not longer required PHPUnit versions --- Tests/Console/MassiveOutputFormatterTest.php | 18 ++++++------------ composer.json | 4 ++-- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Tests/Console/MassiveOutputFormatterTest.php b/Tests/Console/MassiveOutputFormatterTest.php index ff02ce2..7f247b2 100644 --- a/Tests/Console/MassiveOutputFormatterTest.php +++ b/Tests/Console/MassiveOutputFormatterTest.php @@ -21,8 +21,6 @@ class MassiveOutputFormatterTest extends BaseTestCase * @param string $message * @param int $indent * @param string $expected - * - * @dataProvider getDecorationDataProvider */ #[DataProvider('getDecorationDataProvider')] public function testThatOutputWillBeDecorated($message, $indent, $expected) @@ -35,16 +33,14 @@ public function testThatOutputWillBeDecorated($message, $indent, $expected) public static function getDecorationDataProvider() { - yield ['Some string', 0, 'Some string']; - yield ['Some string', 1, ' Some string']; - yield ['Some string', 2, ' Some string']; + yield ['Some string', 0, 'Some string']; + yield ['Some string', 1, ' Some string']; + yield ['Some string', 2, ' Some string']; } /** * @param string $message * @param int $indent - * - * @dataProvider getNonDecorationDataProvider */ #[DataProvider('getNonDecorationDataProvider')] public function testThatOutputWillNotBeDecorated($message, $indent) @@ -57,10 +53,8 @@ public function testThatOutputWillNotBeDecorated($message, $indent) public static function getNonDecorationDataProvider() { - return [ - ['Some string', 0], - ['Some string', 1], - ['Some string', 2], - ]; + yield ['Some string', 0]; + yield ['Some string', 1]; + yield ['Some string', 2]; } } diff --git a/composer.json b/composer.json index c373484..1f5a69d 100644 --- a/composer.json +++ b/composer.json @@ -17,8 +17,8 @@ "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^9.6 || ^10.0 || ^11.0 || ^12.0", - "matthiasnoback/symfony-dependency-injection-test": "^5.1 || ^6.0", + "phpunit/phpunit": "^11.0 || ^12.0", + "matthiasnoback/symfony-dependency-injection-test": "^6.2", "phpspec/prophecy": "^1.14", "phpspec/prophecy-phpunit": "^2.0" },