diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8deb964..190aab4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -10,7 +10,7 @@ jobs: name: PHPStan steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: PHPStan uses: docker://oskarstark/phpstan-ga env: @@ -22,7 +22,7 @@ jobs: name: PHP-CS-Fixer steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Fix CS uses: docker://oskarstark/php-cs-fixer-ga tests: @@ -31,14 +31,15 @@ jobs: matrix: include: - description: 'Lowest' - php: '8.0' - composer_option: '--prefer-lowest' - - description: 'Symfony 5.4' php: '8.1' - symfony: 5.4.* - - description: 'Symfony 6.2' + symfony: 6.4.*@dev + composer_option: '--prefer-lowest' + - description: 'Symfony 6.4' php: '8.2' - symfony: 6.2.* + symfony: 6.4.*@dev + - description: 'Symfony 7.0' + php: '8.3' + symfony: 7.0.*@dev name: PHP ${{ matrix.php }} tests (${{ matrix.description }}) steps: - name: Checkout @@ -52,9 +53,17 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - - run: | - sed -ri 's/"symfony\/(.+)": "(.+)"/"symfony\/\1": "'${{ matrix.symfony }}'"/' composer.json; + - name: Require specific Symfony version if: matrix.symfony - - run: composer update --no-interaction --no-progress --ansi ${{ matrix.composer_option }} - - run: vendor/bin/phpunit + run: | + sed -ri 's/"symfony\/(.+)": "(.+)"/"symfony\/\1": "'${{ matrix.symfony }}'"/' composer.json; + - name: Use possible dev deps + if: contains(matrix.symfony, '@dev') + run: | + composer config minimum-stability dev + composer config prefer-stable true + - name: Update vendors + run: composer update --no-interaction --no-progress --ansi ${{ matrix.composer_option }} + - name: Run tests + run: vendor/bin/phpunit diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index b8939f3..b46948b 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -10,9 +10,8 @@ ->setRules([ '@Symfony' => true, '@Symfony:risky' => true, - '@PHP80Migration:risky' => true, + '@PHP81Migration' => true, '@PHPUnit84Migration:risky' => true, - 'ordered_imports' => true, 'declare_strict_types' => false, 'native_function_invocation' => ['include' => ['@all']], 'php_unit_mock_short_will_return' => true, diff --git a/composer.json b/composer.json index c6c350a..b5459c2 100644 --- a/composer.json +++ b/composer.json @@ -11,15 +11,15 @@ } ], "require": { - "php": "^8.0", - "symfony/config": "^5.4 || ^6.0", - "symfony/dependency-injection": "^5.4 || ^6.0", - "symfony/form": "^5.4 || ^6.0", - "symfony/http-kernel": "^5.4 || ^6.0", - "twig/twig": "^3.0" + "php": "^8.1", + "symfony/config": "^6.4 || ^7.0", + "symfony/dependency-injection": "^6.4 || ^7.0", + "symfony/form": "^6.4 || ^7.0", + "symfony/http-kernel": "^6.4 || ^7.0", + "twig/twig": "^3.8" }, "require-dev": { - "dg/bypass-finals": "^1.3", + "dg/bypass-finals": "^1.5", "phpunit/phpunit": "^9.6" }, "config": { diff --git a/src/Filter.php b/src/Filter.php index 066534a..31ffff8 100644 --- a/src/Filter.php +++ b/src/Filter.php @@ -13,11 +13,10 @@ final class Filter { /** @var array */ - private array $forms; + private array $forms = []; public function __construct(private FormFactoryInterface $formFactory, private RequestStack $requestStack) { - $this->forms = []; } /** diff --git a/tests/DependencyInjection/FilterExtensionTest.php b/tests/DependencyInjection/FilterExtensionTest.php index 069ecc9..c5bfbbb 100644 --- a/tests/DependencyInjection/FilterExtensionTest.php +++ b/tests/DependencyInjection/FilterExtensionTest.php @@ -22,7 +22,7 @@ public function testPrependWithoutTwig(): void /** @var ContainerBuilder&\PHPUnit\Framework\MockObject\MockObject $container */ $container = $this->getMockBuilder(ContainerBuilder::class)->disableOriginalConstructor()->getMock(); $container->expects(self::once())->method('hasExtension')->willReturn(false); - $container->expects(self::never())->method('prependExtensionConfig')->willReturn(true); + $container->expects(self::never())->method('prependExtensionConfig'); $extension = new FilterExtension(); $extension->prepend($container); } @@ -32,7 +32,7 @@ public function testPrependWithTwig(): void /** @var ContainerBuilder&\PHPUnit\Framework\MockObject\MockObject $container */ $container = $this->getMockBuilder(ContainerBuilder::class)->disableOriginalConstructor()->getMock(); $container->expects(self::once())->method('hasExtension')->willReturn(true); - $container->expects(self::once())->method('prependExtensionConfig')->willReturn(true); + $container->expects(self::once())->method('prependExtensionConfig'); $extension = new FilterExtension(); $extension->prepend($container); }