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/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' }
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/Console/MassiveOutputFormatterTest.php b/Tests/Console/MassiveOutputFormatterTest.php
index 521f118..7f247b2 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
{
@@ -20,9 +21,8 @@ class MassiveOutputFormatterTest extends BaseTestCase
* @param string $message
* @param int $indent
* @param string $expected
- *
- * @dataProvider getDecorationDataProvider
*/
+ #[DataProvider('getDecorationDataProvider')]
public function testThatOutputWillBeDecorated($message, $indent, $expected)
{
$formatter = new MassiveOutputFormatter(true);
@@ -31,21 +31,18 @@ public function testThatOutputWillBeDecorated($message, $indent, $expected)
$this->assertEquals($expected, $result);
}
- public function getDecorationDataProvider()
+ 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'];
}
/**
* @param string $message
* @param int $indent
- *
- * @dataProvider getNonDecorationDataProvider
*/
+ #[DataProvider('getNonDecorationDataProvider')]
public function testThatOutputWillNotBeDecorated($message, $indent)
{
$formatter = new MassiveOutputFormatter(false);
@@ -54,12 +51,10 @@ public function testThatOutputWillNotBeDecorated($message, $indent)
$this->assertEquals($message, $result);
}
- public function getNonDecorationDataProvider()
+ 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/Tests/ProphecyTrait.php b/Tests/ProphecyTrait.php
deleted file mode 100644
index 24b1255..0000000
--- a/Tests/ProphecyTrait.php
+++ /dev/null
@@ -1,23 +0,0 @@
-=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"
+ "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": "^8.5",
- "matthiasnoback/symfony-dependency-injection-test": "^4.0 || ^5.0",
- "phpspec/prophecy": "^1.14"
+ "phpunit/phpunit": "^11.0 || ^12.0",
+ "matthiasnoback/symfony-dependency-injection-test": "^6.2",
+ "phpspec/prophecy": "^1.14",
+ "phpspec/prophecy-phpunit": "^2.0"
},
"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
-
-
-
- ./
-
-
-
+
+
+ .
+
+