From 7a8d7c91f1642c684f4476e6d82b44eab607b63a Mon Sep 17 00:00:00 2001 From: Eloar Date: Fri, 17 Dec 2021 08:34:14 +0100 Subject: [PATCH 1/2] Symfony 5.4 deprecations adressed --- Command/SetupFabricCommand.php | 2 +- DependencyInjection/Configuration.php | 2 +- .../OldSoundRabbitMqExtension.php | 14 +++++---- phpunit.xml | 29 +++++++++++++++++++ 4 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 phpunit.xml diff --git a/Command/SetupFabricCommand.php b/Command/SetupFabricCommand.php index d6bbbe83..933b5a28 100644 --- a/Command/SetupFabricCommand.php +++ b/Command/SetupFabricCommand.php @@ -18,7 +18,7 @@ protected function configure() ; } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { if (defined('AMQP_DEBUG') === false) { define('AMQP_DEBUG', (bool) $input->getOption('debug')); diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index dd9e04cb..24921017 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -29,7 +29,7 @@ public function __construct($name) $this->name = $name; } - public function getConfigTreeBuilder() + public function getConfigTreeBuilder(): TreeBuilder { $tree = new TreeBuilder($this->name); /** @var ArrayNodeDefinition $rootNode */ diff --git a/DependencyInjection/OldSoundRabbitMqExtension.php b/DependencyInjection/OldSoundRabbitMqExtension.php index bab7c52d..196bac2f 100644 --- a/DependencyInjection/OldSoundRabbitMqExtension.php +++ b/DependencyInjection/OldSoundRabbitMqExtension.php @@ -4,6 +4,7 @@ use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface; use OldSound\RabbitMqBundle\RabbitMq\ProducerInterface; +use Symfony\Component\Config\Definition\ConfigurationInterface; use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -71,7 +72,7 @@ public function load(array $configs, ContainerBuilder $container) } } - public function getConfiguration(array $config, ContainerBuilder $container) + public function getConfiguration(array $config, ContainerBuilder $container): ?ConfigurationInterface { return new Configuration($this->getAlias()); } @@ -531,7 +532,7 @@ protected function loadAnonConsumers() * * @return array */ - private function normalizeArgumentKeys(array $config) + private function normalizeArgumentKeys(array $config): array { if (isset($config['arguments'])) { $arguments = $config['arguments']; @@ -559,7 +560,7 @@ private function normalizeArgumentKeys(array $config) * @param string $arguments * @return array */ - private function argumentsStringAsArray($arguments) + private function argumentsStringAsArray($arguments): array { $argumentsArray = array(); @@ -654,7 +655,7 @@ protected function injectConnection(Definition $definition, $connectionName) $definition->addArgument(new Reference(sprintf('old_sound_rabbit_mq.connection.%s', $connectionName))); } - public function getAlias() + public function getAlias(): string { return 'old_sound_rabbit_mq'; } @@ -664,6 +665,7 @@ public function getAlias() * * @param string $callback * @param string $name + * @throws \ReflectionException */ protected function addDequeuerAwareCall($callback, $name) { @@ -691,7 +693,7 @@ private function injectLogger(Definition $definition) * * @return array */ - protected function getDefaultExchangeOptions() + protected function getDefaultExchangeOptions(): array { return array( 'name' => '', @@ -706,7 +708,7 @@ protected function getDefaultExchangeOptions() * * @return array */ - protected function getDefaultQueueOptions() + protected function getDefaultQueueOptions(): array { return array( 'name' => '', diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 00000000..ef87dd78 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,29 @@ + + + + + + Tests + + + + + + . + + Resources + Tests + vendor + + + + From 74cc7cc924fdf7c8aa6d1c79f8251500e4149249 Mon Sep 17 00:00:00 2001 From: mihaileu <54336101+mihaileu@users.noreply.github.com> Date: Tue, 21 Dec 2021 15:12:25 +0200 Subject: [PATCH 2/2] Delete phpunit.xml --- phpunit.xml | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 phpunit.xml diff --git a/phpunit.xml b/phpunit.xml deleted file mode 100644 index ef87dd78..00000000 --- a/phpunit.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - Tests - - - - - - . - - Resources - Tests - vendor - - - -