From cd4ff5ce460e8e20cf15c1879943e0d2eb0bab03 Mon Sep 17 00:00:00 2001 From: Encre Informatique Date: Thu, 14 Nov 2024 21:00:30 +0100 Subject: [PATCH 1/3] maintenance : deprecation symfony Return void type for method in EkoFeedExtension. Resolve the `might add "void" as a native return type declaration in the future` --- DependencyInjection/EkoFeedExtension.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DependencyInjection/EkoFeedExtension.php b/DependencyInjection/EkoFeedExtension.php index 97b2e33..0bd2a20 100644 --- a/DependencyInjection/EkoFeedExtension.php +++ b/DependencyInjection/EkoFeedExtension.php @@ -31,7 +31,7 @@ class EkoFeedExtension extends Extension * @param array $configs An array of configuration settings * @param ContainerBuilder $container A container builder instance */ - public function load(array $configs, ContainerBuilder $container) + public function load(array $configs, ContainerBuilder $container): void { $config = $this->processConfiguration(new Configuration(), $configs); @@ -55,7 +55,7 @@ public function load(array $configs, ContainerBuilder $container) * * @throws \RuntimeException */ - protected function configureHydrator(array $config, ContainerBuilder $container) + protected function configureHydrator(array $config, ContainerBuilder $container): void { if (!$container->hasDefinition($config['hydrator'])) { throw new \RuntimeException(sprintf('Unable to load hydrator service "%s"', $config['hydrator'])); From 4889cee671c11574136e8e95a39b8bc8d9059d60 Mon Sep 17 00:00:00 2001 From: Daniel Burckhardt Date: Mon, 17 Mar 2025 09:26:02 +0100 Subject: [PATCH 2/3] Switch to explicit nullable types (Deprecation in PHP 8.4) --- Command/FeedDumpCommand.php | 2 +- Formatter/Formatter.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Command/FeedDumpCommand.php b/Command/FeedDumpCommand.php index 4f25d61..3b9ca68 100644 --- a/Command/FeedDumpCommand.php +++ b/Command/FeedDumpCommand.php @@ -39,7 +39,7 @@ class FeedDumpCommand extends Command */ private $feedDumpService; - public function __construct(RouterInterface $router, FeedDumpService $feedDumpService = null) + public function __construct(RouterInterface $router, ?FeedDumpService $feedDumpService = null) { $this->router = $router; $this->feedDumpService = $feedDumpService; diff --git a/Formatter/Formatter.php b/Formatter/Formatter.php index 2d5a5d6..2415131 100644 --- a/Formatter/Formatter.php +++ b/Formatter/Formatter.php @@ -326,7 +326,7 @@ protected function formatWithOptions(ItemFieldInterface $field, ItemInterface $i * @param ItemFieldInterface $field A feed field instance * @param ItemInterface|null $item A feed item instance */ - protected function addAttributes(\DOMElement $element, ItemFieldInterface $field, ItemInterface $item = null) + protected function addAttributes(\DOMElement $element, ItemFieldInterface $field, ?ItemInterface $item = null) { foreach ($field->getAttributes() as $key => $value) { if ($item) { From 0cf3dfa565bee0b0093cc04e1545c63cc03e3dc8 Mon Sep 17 00:00:00 2001 From: Daniel Burckhardt Date: Mon, 1 Dec 2025 12:27:27 +0100 Subject: [PATCH 3/3] Add void return types to address Symfony deprecations --- Command/FeedDumpCommand.php | 2 +- DependencyInjection/Compiler/FeedDumpServicePass.php | 2 +- DependencyInjection/Compiler/FeedFormatterPass.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Command/FeedDumpCommand.php b/Command/FeedDumpCommand.php index 3b9ca68..2244325 100644 --- a/Command/FeedDumpCommand.php +++ b/Command/FeedDumpCommand.php @@ -50,7 +50,7 @@ public function __construct(RouterInterface $router, ?FeedDumpService $feedDumpS /** * {@inheritdoc} */ - protected function configure() + protected function configure(): void { $this ->setDescription('Generate (dump) a feed in an XML file') diff --git a/DependencyInjection/Compiler/FeedDumpServicePass.php b/DependencyInjection/Compiler/FeedDumpServicePass.php index fa2bba8..4fc10b9 100644 --- a/DependencyInjection/Compiler/FeedDumpServicePass.php +++ b/DependencyInjection/Compiler/FeedDumpServicePass.php @@ -25,7 +25,7 @@ class FeedDumpServicePass implements CompilerPassInterface /** * {@inheritdoc} */ - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { if (!$container->hasAlias('doctrine.orm.entity_manager')) { $container->removeDefinition(FeedDumpService::class); diff --git a/DependencyInjection/Compiler/FeedFormatterPass.php b/DependencyInjection/Compiler/FeedFormatterPass.php index d59d46d..43b1866 100644 --- a/DependencyInjection/Compiler/FeedFormatterPass.php +++ b/DependencyInjection/Compiler/FeedFormatterPass.php @@ -25,7 +25,7 @@ class FeedFormatterPass implements CompilerPassInterface /** * {@inheritdoc} */ - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { $formatters = [];