Skip to content

Symfony 5.4 deprecations adressed #679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Command/SetupFabricCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
14 changes: 8 additions & 6 deletions DependencyInjection/OldSoundRabbitMqExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unlikely that this method will return null ever.

{
return new Configuration($this->getAlias());
}
Expand Down Expand Up @@ -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'];
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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() : string
public function getAlias(): string
{
return 'old_sound_rabbit_mq';
}
Expand All @@ -664,6 +665,7 @@ public function getAlias() : string
*
* @param string $callback
* @param string $name
* @throws \ReflectionException
*/
protected function addDequeuerAwareCall($callback, $name)
{
Expand Down Expand Up @@ -691,7 +693,7 @@ private function injectLogger(Definition $definition)
*
* @return array
*/
protected function getDefaultExchangeOptions()
protected function getDefaultExchangeOptions(): array
{
return array(
'name' => '',
Expand All @@ -706,7 +708,7 @@ protected function getDefaultExchangeOptions()
*
* @return array
*/
protected function getDefaultQueueOptions()
protected function getDefaultQueueOptions(): array
{
return array(
'name' => '',
Expand Down