diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5e3d3521..8b6c33aa 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -42,11 +42,6 @@ jobs: dependencies: lowest allowed-to-fail: false variant: normal - - php-version: '8.2' - dependencies: highest - allowed-to-fail: false - symfony-require: 4.4.* - variant: symfony/symfony:"4.4.*" - php-version: '8.2' dependencies: highest allowed-to-fail: false diff --git a/composer.json b/composer.json index f2694130..32f0691b 100644 --- a/composer.json +++ b/composer.json @@ -24,14 +24,14 @@ "ext-json": "*", "sonata-project/block-bundle": "^4.18", "sonata-project/exporter": "^2.0 || ^3.0", - "symfony/config": "^4.4 || ^5.4 || ^6.2", - "symfony/dependency-injection": "^4.4 || ^5.4 || ^6.2", - "symfony/form": "^4.4 || ^5.4 || ^6.2", - "symfony/framework-bundle": "^4.4 || ^5.4 || ^6.2", - "symfony/http-foundation": "^4.4 || ^5.4 || ^6.2", - "symfony/http-kernel": "^4.4.13 || ^5.4 || ^6.2", - "symfony/options-resolver": "^4.4 || ^5.4 || ^6.2", - "twig/twig": "^2.9 || ^3.0" + "symfony/config": "^5.4 || ^6.2", + "symfony/dependency-injection": "^5.4 || ^6.2", + "symfony/form": "^5.4 || ^6.2", + "symfony/framework-bundle": "^5.4 || ^6.2", + "symfony/http-foundation": "^5.4 || ^6.2", + "symfony/http-kernel": "^5.4 || ^6.2", + "symfony/options-resolver": "^5.4 || ^6.2", + "twig/twig": "^3.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.4", @@ -45,12 +45,12 @@ "phpunit/phpunit": "^9.5", "psalm/plugin-phpunit": "^0.18", "rector/rector": "^0.15", - "symfony/console": "^4.4 || ^5.4 || ^6.2", - "symfony/filesystem": "^4.4 || ^5.4 || ^6.2", - "symfony/finder": "^4.4 || ^5.4 || ^6.2", + "symfony/console": "^5.4 || ^6.2", + "symfony/filesystem": "^5.4 || ^6.2", + "symfony/finder": "^5.4 || ^6.2", "symfony/phpunit-bridge": "^6.2", - "symfony/yaml": "^4.4 || ^5.4 || ^6.2", - "vimeo/psalm": "^4.7.2 || ^5.0" + "symfony/yaml": "^5.4 || ^6.2", + "vimeo/psalm": "^5.0" }, "autoload": { "psr-4": { diff --git a/src/Command/SitemapGeneratorCommand.php b/src/Command/SitemapGeneratorCommand.php index b64bc4d4..6bacb5bd 100644 --- a/src/Command/SitemapGeneratorCommand.php +++ b/src/Command/SitemapGeneratorCommand.php @@ -36,10 +36,6 @@ #[AsCommand(name: 'sonata:seo:sitemap', description: 'Create a sitemap')] final class SitemapGeneratorCommand extends Command { - // TODO: Remove static properties when support for Symfony < 5.4 is dropped. - protected static $defaultName = 'sonata:seo:sitemap'; - protected static $defaultDescription = 'Create a sitemap'; - public function __construct( private RouterInterface $router, private SourceManager $sitemapManager, @@ -50,11 +46,7 @@ public function __construct( public function configure(): void { - \assert(null !== static::$defaultDescription); - $this - // TODO: Remove setDescription when support for Symfony < 5.4 is dropped. - ->setDescription(static::$defaultDescription) ->setHelp(<<<'EOT' The sonata:seo:sitemap command create new sitemap files (index + sitemap). EOT) diff --git a/src/Resources/config/blocks.php b/src/Resources/config/blocks.php index c47a371c..e02b9907 100644 --- a/src/Resources/config/blocks.php +++ b/src/Resources/config/blocks.php @@ -11,14 +11,11 @@ * file that was distributed with this source code. */ +namespace Symfony\Component\DependencyInjection\Loader\Configurator; + use Sonata\SeoBundle\Block\Breadcrumb\HomepageBreadcrumbBlockService; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -use Symfony\Component\DependencyInjection\Loader\Configurator\ReferenceConfigurator; return static function (ContainerConfigurator $containerConfigurator): void { - // Use "service" function for creating references to services when dropping support for Symfony 4.4 - // Use "param" function for creating references to parameters when dropping support for Symfony 5.1 - $containerConfigurator->services() ->set('sonata.seo.block.breadcrumb.homepage', HomepageBreadcrumbBlockService::class) @@ -26,7 +23,7 @@ ->tag('sonata.block') ->tag('sonata.breadcrumb') ->args([ - new ReferenceConfigurator('twig'), - new ReferenceConfigurator('knp_menu.factory'), + service('twig'), + service('knp_menu.factory'), ]); }; diff --git a/src/Resources/config/commands.php b/src/Resources/config/commands.php index d4073a75..f0810f5e 100644 --- a/src/Resources/config/commands.php +++ b/src/Resources/config/commands.php @@ -11,20 +11,18 @@ * file that was distributed with this source code. */ +namespace Symfony\Component\DependencyInjection\Loader\Configurator; + use Sonata\SeoBundle\Command\SitemapGeneratorCommand; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -use Symfony\Component\DependencyInjection\Loader\Configurator\ReferenceConfigurator; return static function (ContainerConfigurator $containerConfigurator): void { - // Use "service" function for creating references to services when dropping support for Symfony 4.4 - // Use "param" function for creating references to parameters when dropping support for Symfony 5.1 $containerConfigurator->services() ->set(SitemapGeneratorCommand::class) ->tag('console.command') ->args([ - new ReferenceConfigurator('router'), - new ReferenceConfigurator('sonata.seo.sitemap.manager'), - new ReferenceConfigurator('filesystem'), + service('router'), + service('sonata.seo.sitemap.manager'), + service('filesystem'), ]); }; diff --git a/src/Resources/config/event.php b/src/Resources/config/event.php index 537b4bf6..d7140805 100644 --- a/src/Resources/config/event.php +++ b/src/Resources/config/event.php @@ -11,12 +11,11 @@ * file that was distributed with this source code. */ +namespace Symfony\Component\DependencyInjection\Loader\Configurator; + use Sonata\SeoBundle\Event\BreadcrumbListener; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return static function (ContainerConfigurator $containerConfigurator): void { - // Use "service" function for creating references to services when dropping support for Symfony 4.4 - // Use "param" function for creating references to parameters when dropping support for Symfony 5.1 $containerConfigurator->services() ->set('sonata.seo.event.breadcrumb', BreadcrumbListener::class) diff --git a/src/Resources/config/services.php b/src/Resources/config/services.php index 1ab08496..33e6d694 100644 --- a/src/Resources/config/services.php +++ b/src/Resources/config/services.php @@ -11,15 +11,13 @@ * file that was distributed with this source code. */ +namespace Symfony\Component\DependencyInjection\Loader\Configurator; + use Sonata\SeoBundle\Seo\SeoPage; use Sonata\SeoBundle\Sitemap\SourceManager; use Sonata\SeoBundle\Twig\Extension\SeoExtension; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -use Symfony\Component\DependencyInjection\Loader\Configurator\ReferenceConfigurator; return static function (ContainerConfigurator $containerConfigurator): void { - // Use "service" function for creating references to services when dropping support for Symfony 4.4 - // Use "param" function for creating references to parameters when dropping support for Symfony 5.1 $containerConfigurator->services() ->set('sonata.seo.page.default', SeoPage::class) @@ -28,8 +26,8 @@ ->set('sonata.seo.twig.extension', SeoExtension::class) ->tag('twig.extension') ->args([ - new ReferenceConfigurator('sonata.seo.page'), - '', + service('sonata.seo.page'), + abstract_arg('encoding'), ]) ->set('sonata.seo.sitemap.manager', SourceManager::class);