Skip to content

Commit

Permalink
Add Symfony 7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
mbabker committed Dec 13, 2023
1 parent 1ad9014 commit a546f09
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 20 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ['8.1', '8.2']
symfony: ['5.4.*', '6.2.*', '6.3.*']
php: ['8.1', '8.2', '8.3']
symfony: ['5.4.*', '6.3.*', '6.4.*', '7.0.*']
pagerfanta: ['']
composer-flags: ['--prefer-stable']
can-fail: [false]
with-twig: [true]
include:
# Run "no Twig" build on latest PHP and Symfony LTS
- php: '8.2'
symfony: '5.4.*'
symfony: '6.4.*'
composer-flags: '--prefer-stable'
can-fail: false
with-twig: false
Expand All @@ -27,6 +27,9 @@ jobs:
composer-flags: '--prefer-stable --prefer-lowest'
can-fail: false
with-twig: true
exclude:
- php: '8.1'
symfony: '7.0.*'

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) || '' }}"

Expand Down
32 changes: 16 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,38 @@
"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",
"jms/serializer-bundle": "^4.2 || ^5.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.3.1",
"matthiasnoback/symfony-dependency-injection-test": "^5.0@dev",
"pagerfanta/twig": "^3.7 || ^4.0",
"phpstan/extension-installer": "^1.2",
"phpstan/phpstan": "1.10.34",
"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": "*"
},
Expand Down
2 changes: 1 addition & 1 deletion src/BabDevPagerfantaBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
9 changes: 9 additions & 0 deletions tests/Serializer/Normalizer/PagerfantaNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
);
Expand Down Expand Up @@ -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());
}

Expand Down

0 comments on commit a546f09

Please sign in to comment.