diff --git a/composer.json b/composer.json index 8ae4a87..8ab43ff 100644 --- a/composer.json +++ b/composer.json @@ -27,23 +27,23 @@ "require": { "php": ">=8.0", "spomky-labs/cbor-php": "^3.0", - "symfony/config": "^5.3|^6.0", - "symfony/dependency-injection": "^5.3|^6.0", - "symfony/http-kernel": "^5.3|^6.0" + "symfony/config": "^5.3|^6.0|^7.0", + "symfony/dependency-injection": "^5.3|^6.0|^7.0", + "symfony/http-kernel": "^5.3|^6.0|^7.0" }, "require-dev": { - "infection/infection": "^0.27", + "infection/infection": "^0.28", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.0", "phpstan/phpstan-beberlei-assert": "^1.0", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.0", - "rector/rector": "^0.16", - "symfony/framework-bundle": "^5.3|^6.0", - "symfony/phpunit-bridge": "^5.3|^6.0", - "symplify/easy-coding-standard": "^11.0" + "phpunit/phpunit": "^10.1|^11.0", + "rector/rector": "^1.0", + "symfony/framework-bundle": "^5.3|^6.0|^7.0", + "symfony/phpunit-bridge": "^5.3|^6.0|^7.0", + "symplify/easy-coding-standard": "^12.0" }, "config": { "sort-packages": true, diff --git a/ecs.php b/ecs.php index b9f77ce..d4761f0 100644 --- a/ecs.php +++ b/ecs.php @@ -47,7 +47,6 @@ $config->import(SetList::NAMESPACES); $config->import(SetList::STRICT); - $services = $config->services(); $config->rule(StrictParamFixer::class); $config->rule(StrictComparisonFixer::class); $config->rule(ArrayIndentationFixer::class); @@ -89,9 +88,15 @@ 'import_functions' => true, ]); - $config->services() - ->remove(PhpUnitTestClassRequiresCoversFixer::class); $config->parallel(); $config->paths([__DIR__]); - $config->skip([__DIR__ . '/.github', __DIR__ . '/build', __DIR__ . '/vendor', __DIR__ . '/var']); + $config->skip( + [ + __DIR__ . '/.github', + __DIR__ . '/build', + __DIR__ . '/vendor', + __DIR__ . '/var', + PhpUnitTestClassRequiresCoversFixer::class, + ] + ); }; diff --git a/phpunit.xml.dist b/phpunit.xml.dist index bf0652a..896cf15 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,17 +1,14 @@ - - - - ./src - - - ./vendor - ./tests - - + - ./tests + ./tests @@ -21,7 +18,13 @@ - - - + + + ./src + + + ./vendor + ./tests + + diff --git a/rector.php b/rector.php index d726517..89e6852 100644 --- a/rector.php +++ b/rector.php @@ -3,14 +3,18 @@ declare(strict_types=1); use Rector\Config\RectorConfig; -use Rector\Core\ValueObject\PhpVersion; +use Rector\PHPUnit\Set\PHPUnitSetList; use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; use Rector\Symfony\Set\SymfonySetList; +use Rector\ValueObject\PhpVersion; return static function (RectorConfig $config): void { $config->import(SetList::DEAD_CODE); $config->import(LevelSetList::UP_TO_PHP_80); + $config->import(\Rector\PHPUnit\Set\PHPUnitLevelSetList::UP_TO_PHPUNIT_100); + $config->import(PHPUnitSetList::PHPUNIT_CODE_QUALITY); + $config->import(PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES); $config->import(SymfonySetList::SYMFONY_CODE_QUALITY); $config->parallel(); $config->paths([__DIR__ . '/src', __DIR__ . '/tests']); diff --git a/src/DependencyInjection/Compiler/OtherObjectCompilerPass.php b/src/DependencyInjection/Compiler/OtherObjectCompilerPass.php index 71ccec4..fef7d1e 100644 --- a/src/DependencyInjection/Compiler/OtherObjectCompilerPass.php +++ b/src/DependencyInjection/Compiler/OtherObjectCompilerPass.php @@ -13,9 +13,6 @@ final class OtherObjectCompilerPass implements CompilerPassInterface { public const TAG = 'cbor.other_object'; - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container): void { if (! $container->hasDefinition(OtherObjectManagerInterface::class)) { diff --git a/src/DependencyInjection/Compiler/TagCompilerPass.php b/src/DependencyInjection/Compiler/TagCompilerPass.php index 30cf743..436a9d4 100644 --- a/src/DependencyInjection/Compiler/TagCompilerPass.php +++ b/src/DependencyInjection/Compiler/TagCompilerPass.php @@ -13,9 +13,6 @@ final class TagCompilerPass implements CompilerPassInterface { public const TAG = 'cbor.tag'; - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container): void { if (! $container->hasDefinition(TagManagerInterface::class)) { diff --git a/src/SpomkyLabsCborBundle.php b/src/SpomkyLabsCborBundle.php index e2bffe6..a33c812 100644 --- a/src/SpomkyLabsCborBundle.php +++ b/src/SpomkyLabsCborBundle.php @@ -17,7 +17,7 @@ public function getContainerExtension(): SpomkyLabsCborExtension return new SpomkyLabsCborExtension(); } - public function build(ContainerBuilder $container) + public function build(ContainerBuilder $container): void { parent::build($container); $container->addCompilerPass(new TagCompilerPass()); diff --git a/tests/Functional/DecodingTest.php b/tests/Functional/DecodingTest.php index 998fd26..efcf7f5 100644 --- a/tests/Functional/DecodingTest.php +++ b/tests/Functional/DecodingTest.php @@ -6,20 +6,24 @@ use CBOR\Decoder; use CBOR\Normalizable; -use function is_string; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Depends; +use PHPUnit\Framework\Attributes\Test; use RuntimeException; use SpomkyLabs\CborBundle\CBORDecoder; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; +use function is_string; /** * @internal */ final class DecodingTest extends KernelTestCase { - /** + #[Test] + public static /** * @test */ - public static function theDecoderServiceIsAvailable(): void + function theDecoderServiceIsAvailable(): void { //Given static::bootKernel(); @@ -28,13 +32,13 @@ public static function theDecoderServiceIsAvailable(): void static::assertTrue(static::getContainer()->has(Decoder::class)); } - /** + #[Test] + #[DataProvider('getInputs')] + #[Depends('testTheDecoderServiceIsAvailable')] + public static /** * @test - * @depends theDecoderServiceIsAvailable - * - * @dataProvider getInputs */ - public static function theDecoderCanDecodeInputs(string $data, string $expectedNormalizedValue): void + function theDecoderCanDecodeInputs(string $data, string $expectedNormalizedValue): void { //Given static::bootKernel(); diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..99a2941 --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,7 @@ +