From 1396ca04a52c558c2ee287754034ce90c29c87aa Mon Sep 17 00:00:00 2001 From: Renaud Date: Fri, 13 Feb 2026 16:36:08 +0100 Subject: [PATCH] Fix Symfony 8 compatibility --- composer.json | 6 +++--- config/services.php | 12 ++++++++++++ config/services.xml | 10 ---------- src/PixelshapedFlatMapperBundle.php | 2 +- tests/Functional/BundleFunctionalTest.php | 6 +++--- 5 files changed, 19 insertions(+), 17 deletions(-) create mode 100644 config/services.php delete mode 100644 config/services.xml diff --git a/composer.json b/composer.json index 3d2106d..77b2c96 100644 --- a/composer.json +++ b/composer.json @@ -23,9 +23,9 @@ "require": { "php": "^8.2", "symfony/cache-contracts": "^2.5 || ^3.3", - "symfony/config": "^5.4 || ^6.0 || ^7.0 || ^8.0", - "symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0 || ^8.0", - "symfony/http-kernel": "^5.4 || ^6.0 || ^7.0 || ^8.0" + "symfony/config": "^6.1 || ^7.0 || ^8.0", + "symfony/dependency-injection": "^6.1 || ^7.0 || ^8.0", + "symfony/http-kernel": "^6.1 || ^7.0 || ^8.0" }, "require-dev": { "phpunit/phpunit": "^11.1", diff --git a/config/services.php b/config/services.php new file mode 100644 index 0000000..327826f --- /dev/null +++ b/config/services.php @@ -0,0 +1,12 @@ +services(); + + $services->set('pixelshaped_flat_mapper.flat_mapper', FlatMapper::class)->public(); + $services->alias(FlatMapper::class, 'pixelshaped_flat_mapper.flat_mapper'); +}; diff --git a/config/services.xml b/config/services.xml deleted file mode 100644 index 3c99ded..0000000 --- a/config/services.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/src/PixelshapedFlatMapperBundle.php b/src/PixelshapedFlatMapperBundle.php index f76e3ce..1502614 100644 --- a/src/PixelshapedFlatMapperBundle.php +++ b/src/PixelshapedFlatMapperBundle.php @@ -16,7 +16,7 @@ class PixelshapedFlatMapperBundle extends AbstractBundle */ public function loadExtension(array $config, ContainerConfigurator $container, ContainerBuilder $builder): void { - $container->import('../config/services.xml'); + $container->import('../config/services.php'); $flatMapper = $builder->getDefinition('pixelshaped_flat_mapper.flat_mapper'); if($config['cache_service'] !== null) { diff --git a/tests/Functional/BundleFunctionalTest.php b/tests/Functional/BundleFunctionalTest.php index fe01c2e..f49c527 100644 --- a/tests/Functional/BundleFunctionalTest.php +++ b/tests/Functional/BundleFunctionalTest.php @@ -43,7 +43,7 @@ public function registerBundles(): iterable new PixelshapedFlatMapperBundle(), ]; } - public function registerContainerConfiguration(LoaderInterface $loader) + public function registerContainerConfiguration(LoaderInterface $loader): void { } } @@ -56,7 +56,7 @@ public function registerBundles(): iterable new PixelshapedFlatMapperBundle(), ]; } - public function registerContainerConfiguration(LoaderInterface $loader) + public function registerContainerConfiguration(LoaderInterface $loader): void { $loader->load(function ($container) { // Register a mock cache service @@ -99,4 +99,4 @@ public function tag(iterable|string $tags): static { return $this; } public function getMetadata(): array { return []; } }; } -} \ No newline at end of file +}