diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index c161a0d..af43cc9 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -18,7 +18,7 @@ jobs: include: # Run "no Twig" build on latest PHP and Symfony LTS - php: '8.2' - symfony: '5.4.*' + symfony: '6.4.*@dev' composer-flags: '--prefer-stable' can-fail: false with-twig: false @@ -27,6 +27,16 @@ jobs: composer-flags: '--prefer-stable --prefer-lowest' can-fail: false with-twig: true + - php: '8.2' + symfony: '6.4.*@dev' + composer-flags: '--prefer-stable' + can-fail: true + with-twig: true + - php: '8.2' + symfony: '7.0.*@dev' + composer-flags: '--prefer-stable' + can-fail: true + with-twig: true name: "PHP ${{ matrix.php }}${{ matrix.pagerfanta != '' && format(' - Pagerfanta {0}', matrix.pagerfanta) || '' }}${{ matrix.with-twig == false && ' - Without Twig' || '' }} - Symfony ${{ matrix.symfony }}${{ matrix.composer-flags != '' && format(' - Composer {0}', matrix.composer-flags) || '' }}" diff --git a/composer.json b/composer.json index c4e260b..769c2c3 100644 --- a/composer.json +++ b/composer.json @@ -8,12 +8,12 @@ "php": "^8.1", "pagerfanta/core": "^3.7 || ^4.0", "psr/container": "^1.0 || ^2.0", - "symfony/config": "^5.4 || ^6.2", - "symfony/dependency-injection": "^5.4 || ^6.2", - "symfony/http-foundation": "^5.4 || ^6.2", - "symfony/http-kernel": "^5.4 || ^6.2", - "symfony/property-access": "^5.4 || ^6.2", - "symfony/routing": "^5.4 || ^6.2" + "symfony/config": "^5.4 || ^6.3 || ^7.0", + "symfony/dependency-injection": "^5.4 || ^6.3 || ^7.0", + "symfony/http-foundation": "^5.4 || ^6.3 || ^7.0", + "symfony/http-kernel": "^5.4 || ^6.3 || ^7.0", + "symfony/property-access": "^5.4 || ^6.3 || ^7.0", + "symfony/routing": "^5.4 || ^6.3 || ^7.0" }, "require-dev": { "jms/serializer": "^3.18", @@ -25,21 +25,21 @@ "phpstan/phpstan-phpunit": "1.3.14", "phpstan/phpstan-symfony": "1.3.2", "phpunit/phpunit": "9.6.12", - "symfony/phpunit-bridge": "^5.4 || ^6.2", - "symfony/serializer": "^5.4 || ^6.2", - "symfony/twig-bridge": "^5.4 || ^6.2", - "symfony/twig-bundle": "^5.4 || ^6.2", - "symfony/translation": "^5.4 || ^6.2", + "symfony/phpunit-bridge": "^5.4 || ^6.3 || ^7.0", + "symfony/serializer": "^5.4 || ^6.3 || ^7.0", + "symfony/twig-bridge": "^5.4 || ^6.3 || ^7.0", + "symfony/twig-bundle": "^5.4 || ^6.3 || ^7.0", + "symfony/translation": "^5.4 || ^6.3 || ^7.0", "twig/twig": "^2.13 || ^3.0" }, "conflict": { "jms/serializer": "<3.18", "jms/serializer-bundle": "<4.2", "pagerfanta/twig": "<3.7", - "symfony/serializer": "<5.4 || >=6.0,<6.2", - "symfony/translation": "<5.4 || >=6.0,<6.2", - "symfony/twig-bridge": "<5.4 || >=6.0,<6.2", - "symfony/twig-bundle": "<5.4 || >=6.0,<6.2", + "symfony/serializer": "<5.4 || >=6.0,<6.3", + "symfony/translation": "<5.4 || >=6.0,<6.3", + "symfony/twig-bridge": "<5.4 || >=6.0,<6.3", + "symfony/twig-bundle": "<5.4 || >=6.0,<6.3", "twig/twig": "<2.13", "white-october/pagerfanta-bundle": "*" }, diff --git a/src/BabDevPagerfantaBundle.php b/src/BabDevPagerfantaBundle.php index 05d88ed..da17d03 100644 --- a/src/BabDevPagerfantaBundle.php +++ b/src/BabDevPagerfantaBundle.php @@ -21,7 +21,7 @@ public function build(ContainerBuilder $container): void public function getContainerExtension(): ?ExtensionInterface { - if (null === $this->extension) { + if (!isset($this->extension)) { $this->extension = new BabDevPagerfantaExtension(); } diff --git a/tests/Serializer/Normalizer/PagerfantaNormalizerTest.php b/tests/Serializer/Normalizer/PagerfantaNormalizerTest.php index 13412dd..cac7adc 100644 --- a/tests/Serializer/Normalizer/PagerfantaNormalizerTest.php +++ b/tests/Serializer/Normalizer/PagerfantaNormalizerTest.php @@ -10,6 +10,7 @@ use Pagerfanta\PagerfantaInterface; use PHPUnit\Framework\TestCase; use Symfony\Component\Serializer\Exception\InvalidArgumentException; +use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface; use Symfony\Component\Serializer\Serializer; final class PagerfantaNormalizerTest extends TestCase @@ -42,6 +43,10 @@ public function testNormalize(): void */ public function testNormalizeWithLegacyDecorator(): void { + if (!interface_exists(CacheableSupportsMethodInterface::class)) { + self::markTestSkipped('Test requires symfony/serializer:<6.4'); + } + $pager = new Pagerfanta( new NullAdapter(25), ); @@ -90,6 +95,10 @@ public function testSupportsNormalization(mixed $data, bool $supported): void */ public function testHasCacheableSupportsMethod(): void { + if (!interface_exists(CacheableSupportsMethodInterface::class)) { + self::markTestSkipped('Test requires symfony/serializer:<6.4'); + } + self::assertTrue((new LegacyPagerfantaNormalizer(new PagerfantaNormalizer()))->hasCacheableSupportsMethod()); }