Skip to content

Commit

Permalink
Add support for Symfony 7.1, drop Symfony 6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mbabker committed May 29, 2024
1 parent 444d385 commit de08244
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 21 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
fail-fast: true
matrix:
php: ['8.1', '8.2', '8.3']
symfony: ['5.4.*', '6.3.*', '6.4.*', '7.0.*']
symfony: ['5.4.*', '6.4.*', '7.0.*', '7.1.*@rc']
pagerfanta: ['']
composer-flags: ['--prefer-stable']
can-fail: [false]
Expand All @@ -30,6 +30,8 @@ jobs:
exclude:
- php: '8.1'
symfony: '7.0.*'
- php: '8.1'
symfony: '7.1.*@rc'

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
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Install dependencies
run: composer update --prefer-stable --prefer-dist
env:
SYMFONY_REQUIRE: '7.0.*'
SYMFONY_REQUIRE: '7.1.*@rc'

- name: Run PHPStan
run: vendor/bin/phpstan analyze --error-format=github
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 4.5.0 (2024-??-??)

- Add support for Symfony 7.1
- Drop support for Symfony 6.3

## 4.4.0 (2023-12-20)

- [#60](https://github.com/BabDev/PagerfantaBundle/pull/60) Added Basque locale
Expand Down
30 changes: 15 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"php": "^8.1",
"pagerfanta/core": "^3.7 || ^4.0",
"psr/container": "^1.0 || ^2.0",
"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"
"symfony/config": "^5.4 || ^6.4 || ^7.0",
"symfony/dependency-injection": "^5.4 || ^6.4 || ^7.0",
"symfony/http-foundation": "^5.4 || ^6.4 || ^7.0",
"symfony/http-kernel": "^5.4 || ^6.4 || ^7.0",
"symfony/property-access": "^5.4 || ^6.4 || ^7.0",
"symfony/routing": "^5.4 || ^6.4 || ^7.0"
},
"require-dev": {
"jms/serializer": "^3.18",
Expand All @@ -25,21 +25,21 @@
"phpstan/phpstan-phpunit": "1.4.0",
"phpstan/phpstan-symfony": "1.4.1",
"phpunit/phpunit": "9.6.19",
"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",
"symfony/phpunit-bridge": "^5.4 || ^6.4 || ^7.0",
"symfony/serializer": "^5.4 || ^6.4 || ^7.0",
"symfony/twig-bridge": "^5.4 || ^6.4 || ^7.0",
"symfony/twig-bundle": "^5.4 || ^6.4 || ^7.0",
"symfony/translation": "^5.4 || ^6.4 || ^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.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",
"symfony/serializer": "<5.4 || >=6.0,<6.4",
"symfony/translation": "<5.4 || >=6.0,<6.4",
"symfony/twig-bridge": "<5.4 || >=6.0,<6.4",
"symfony/twig-bundle": "<5.4 || >=6.0,<6.4",
"twig/twig": "<2.13",
"white-october/pagerfanta-bundle": "*"
},
Expand Down
2 changes: 1 addition & 1 deletion docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ The below table shows the supported PHP and Symfony versions for this bundle. No
|---------|-------------------------|--------------|-------------------|
| 2.x | **No Longer Supported** | 7.2-8.0 | 3.4, 4.4, 5.3-5.4 |
| 3.x | Actively Supported | 7.4-8.2 | 4.4, 5.4, 6.0-6.4 |
| 4.x | Actively Supported | 8.1+ | 5.4, 6.3-6.4, 7.0 |
| 4.x | Actively Supported | 8.1+ | 5.4, 6.4, 7.0-7.1 |

<div class="docs-note">When a maximum PHP version is listed, that is the highest version that is tested for support. The bundle may work on newer PHP versions, but support is not guaranteed.</div>
5 changes: 5 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ parameters:
count: 2
path: src/RouteGenerator/RequestAwareRouteGeneratorFactory.php

-
message: "#^Parameter \\#2 \\$parameters of method Symfony\\\\Component\\\\Routing\\\\Generator\\\\UrlGeneratorInterface\\:\\:generate\\(\\) expects array, array\\|object given\\.$#"
count: 1
path: src/RouteGenerator/RouterAwareRouteGenerator.php

-
message: "#^Method BabDev\\\\PagerfantaBundle\\\\View\\\\ContainerBackedImmutableViewFactory\\:\\:get\\(\\) should return Pagerfanta\\\\View\\\\ViewInterface but returns mixed\\.$#"
count: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use BabDev\PagerfantaBundle\DependencyInjection\CompilerPass\RegisterPagerfantaViewsPass;
use BabDev\PagerfantaBundle\View\ContainerBackedImmutableViewFactory;
use Composer\InstalledVersions;
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractCompilerPassTestCase;
use Pagerfanta\View\DefaultView;
use Pagerfanta\View\ViewFactory;
Expand Down Expand Up @@ -40,10 +41,20 @@ public function testViewsAreAddedToTheContainerBackedViewFactory(): void
$this->compile();

$this->assertContainerBuilderHasService('pagerfanta.view.default', DefaultView::class);

// The locator ID is different at Symfony 7.1
$version = InstalledVersions::getVersion('symfony/dependency-injection');

if (null === $version) {
self::fail('Could not detect installed version of symfony/dependency-injection');
}

$locatorId = version_compare($version, '7.1', '>=') ? '.service_locator.mde9.qA' : '.service_locator.3Jj7I65';

$this->assertContainerBuilderHasServiceDefinitionWithArgument(
'pagerfanta.view_factory',
0,
new Reference('.service_locator.3Jj7I65'),
new Reference($locatorId),
);
$this->assertContainerBuilderHasServiceDefinitionWithArgument(
'pagerfanta.view_factory',
Expand Down
4 changes: 2 additions & 2 deletions tests/Serializer/Normalizer/PagerfantaNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function testNormalize(): void
public function testNormalizeWithLegacyDecorator(): void
{
if (!interface_exists(CacheableSupportsMethodInterface::class)) {
self::markTestSkipped('Test requires symfony/serializer:<6.4');
self::markTestSkipped('Test requires symfony/serializer:<=6.4');
}

$pager = new Pagerfanta(
Expand Down Expand Up @@ -96,7 +96,7 @@ 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::markTestSkipped('Test requires symfony/serializer:<=6.4');
}

self::assertTrue((new LegacyPagerfantaNormalizer(new PagerfantaNormalizer()))->hasCacheableSupportsMethod());
Expand Down

0 comments on commit de08244

Please sign in to comment.