From 81ca7b20f562d41544df5e8f50b2db95566ec0ed Mon Sep 17 00:00:00 2001 From: Greg Brown Date: Tue, 11 Jul 2023 13:42:19 -0700 Subject: [PATCH] v3.1.1 -- Updates for symfony 6.3.x deprecations. --- CHANGELOG-3.x.md | 4 ++ src/Command/CreateSearchStorageCommand.php | 2 +- src/Command/CreateStorageCommand.php | 2 +- src/Command/DescribeSearchStorageCommand.php | 2 +- src/Command/DescribeStorageCommand.php | 2 +- src/Command/ExportNodesCommand.php | 2 +- src/Command/GetNodeCommand.php | 2 +- src/Command/ReindexNodesCommand.php | 2 +- src/Command/SyncNodeCommand.php | 2 +- src/Command/SyncNodesCommand.php | 2 +- .../Compiler/ValidateNcrPass.php | 2 +- .../Compiler/ValidateNcrSearchPass.php | 2 +- .../GdbotsNcrExtension.php | 38 +++++++++---------- src/GdbotsNcrBundle.php | 2 +- 14 files changed, 35 insertions(+), 31 deletions(-) diff --git a/CHANGELOG-3.x.md b/CHANGELOG-3.x.md index 9338c85..6a9ece2 100644 --- a/CHANGELOG-3.x.md +++ b/CHANGELOG-3.x.md @@ -2,6 +2,10 @@ This changelog references the relevant changes done in 3.x versions. +## v3.1.1 +* Updates for symfony 6.3.x deprecations. + + ## v3.1.0 * Require gdbots/pbjx-bundle 3.1.x * Use new symfony/php attributes instead of annotations. diff --git a/src/Command/CreateSearchStorageCommand.php b/src/Command/CreateSearchStorageCommand.php index ff898cf..fd9f242 100644 --- a/src/Command/CreateSearchStorageCommand.php +++ b/src/Command/CreateSearchStorageCommand.php @@ -24,7 +24,7 @@ public function __construct(protected ContainerInterface $container, protected N parent::__construct(); } - protected function configure() + protected function configure(): void { $provider = $this->container->getParameter('gdbots_ncr.ncr_search.provider'); diff --git a/src/Command/CreateStorageCommand.php b/src/Command/CreateStorageCommand.php index afd75a4..add09db 100644 --- a/src/Command/CreateStorageCommand.php +++ b/src/Command/CreateStorageCommand.php @@ -24,7 +24,7 @@ public function __construct(protected ContainerInterface $container, protected N parent::__construct(); } - protected function configure() + protected function configure(): void { $provider = $this->container->getParameter('gdbots_ncr.ncr.provider'); diff --git a/src/Command/DescribeSearchStorageCommand.php b/src/Command/DescribeSearchStorageCommand.php index a79cfd5..b9dd598 100644 --- a/src/Command/DescribeSearchStorageCommand.php +++ b/src/Command/DescribeSearchStorageCommand.php @@ -24,7 +24,7 @@ public function __construct(protected ContainerInterface $container, protected N parent::__construct(); } - protected function configure() + protected function configure(): void { $provider = $this->container->getParameter('gdbots_ncr.ncr_search.provider'); diff --git a/src/Command/DescribeStorageCommand.php b/src/Command/DescribeStorageCommand.php index 4f1b076..e3b22cb 100644 --- a/src/Command/DescribeStorageCommand.php +++ b/src/Command/DescribeStorageCommand.php @@ -24,7 +24,7 @@ public function __construct(protected ContainerInterface $container, protected N parent::__construct(); } - protected function configure() + protected function configure(): void { $provider = $this->container->getParameter('gdbots_ncr.ncr.provider'); diff --git a/src/Command/ExportNodesCommand.php b/src/Command/ExportNodesCommand.php index 8f137bd..3639811 100644 --- a/src/Command/ExportNodesCommand.php +++ b/src/Command/ExportNodesCommand.php @@ -25,7 +25,7 @@ public function __construct(protected ContainerInterface $container, protected N parent::__construct(); } - protected function configure() + protected function configure(): void { $provider = $this->container->getParameter('gdbots_ncr.ncr.provider'); diff --git a/src/Command/GetNodeCommand.php b/src/Command/GetNodeCommand.php index ea731b0..b67c17f 100644 --- a/src/Command/GetNodeCommand.php +++ b/src/Command/GetNodeCommand.php @@ -22,7 +22,7 @@ public function __construct(protected ContainerInterface $container, protected N parent::__construct(); } - protected function configure() + protected function configure(): void { $provider = $this->container->getParameter('gdbots_ncr.ncr.provider'); diff --git a/src/Command/ReindexNodesCommand.php b/src/Command/ReindexNodesCommand.php index 785d376..bf33407 100644 --- a/src/Command/ReindexNodesCommand.php +++ b/src/Command/ReindexNodesCommand.php @@ -30,7 +30,7 @@ public function __construct( parent::__construct(); } - protected function configure() + protected function configure(): void { $provider = $this->container->getParameter('gdbots_ncr.ncr.provider'); $searchProvider = $this->container->getParameter('gdbots_ncr.ncr_search.provider'); diff --git a/src/Command/SyncNodeCommand.php b/src/Command/SyncNodeCommand.php index 041281e..19220b9 100644 --- a/src/Command/SyncNodeCommand.php +++ b/src/Command/SyncNodeCommand.php @@ -30,7 +30,7 @@ public function __construct( parent::__construct(); } - protected function configure() + protected function configure(): void { $provider = $this->container->getParameter('gdbots_ncr.ncr.provider'); $searchProvider = $this->container->getParameter('gdbots_ncr.ncr_search.provider'); diff --git a/src/Command/SyncNodesCommand.php b/src/Command/SyncNodesCommand.php index 922df06..f7bdc33 100644 --- a/src/Command/SyncNodesCommand.php +++ b/src/Command/SyncNodesCommand.php @@ -33,7 +33,7 @@ public function __construct( parent::__construct(); } - protected function configure() + protected function configure(): void { $provider = $this->container->getParameter('gdbots_ncr.ncr.provider'); $searchProvider = $this->container->getParameter('gdbots_ncr.ncr_search.provider'); diff --git a/src/DependencyInjection/Compiler/ValidateNcrPass.php b/src/DependencyInjection/Compiler/ValidateNcrPass.php index de936b8..626f17f 100644 --- a/src/DependencyInjection/Compiler/ValidateNcrPass.php +++ b/src/DependencyInjection/Compiler/ValidateNcrPass.php @@ -11,7 +11,7 @@ */ final class ValidateNcrPass implements CompilerPassInterface { - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { if (!$container->hasParameter('gdbots_ncr.ncr.provider')) { return; diff --git a/src/DependencyInjection/Compiler/ValidateNcrSearchPass.php b/src/DependencyInjection/Compiler/ValidateNcrSearchPass.php index 07f1762..0f4445e 100644 --- a/src/DependencyInjection/Compiler/ValidateNcrSearchPass.php +++ b/src/DependencyInjection/Compiler/ValidateNcrSearchPass.php @@ -12,7 +12,7 @@ */ final class ValidateNcrSearchPass implements CompilerPassInterface { - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { if (!$container->hasParameter('gdbots_ncr.ncr_search.provider')) { return; diff --git a/src/DependencyInjection/GdbotsNcrExtension.php b/src/DependencyInjection/GdbotsNcrExtension.php index 98b5039..77fec8e 100644 --- a/src/DependencyInjection/GdbotsNcrExtension.php +++ b/src/DependencyInjection/GdbotsNcrExtension.php @@ -17,12 +17,12 @@ final class GdbotsNcrExtension extends Extension { - public function load(array $config, ContainerBuilder $container) + public function load(array $configs, ContainerBuilder $container): void { $processor = new Processor(); $configuration = new Configuration(); - $config = $processor->processConfiguration($configuration, $config); + $configs = $processor->processConfiguration($configuration, $configs); $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../../config')); $loader->load('ncr.xml'); $loader->load('ncr_cache.xml'); @@ -31,33 +31,33 @@ public function load(array $config, ContainerBuilder $container) $loader->load('twig.xml'); // ncr - $container->setParameter('gdbots_ncr.ncr.provider', $config['ncr']['provider']); - if ($config['ncr']['memoizing']['enabled']) { - $container->setParameter('gdbots_ncr.ncr.memoizing.read_through', $config['ncr']['memoizing']['read_through']); + $container->setParameter('gdbots_ncr.ncr.provider', $configs['ncr']['provider']); + if ($configs['ncr']['memoizing']['enabled']) { + $container->setParameter('gdbots_ncr.ncr.memoizing.read_through', $configs['ncr']['memoizing']['read_through']); } else { $container->removeDefinition('gdbots_ncr.ncr.memoizing'); } - $this->configurePsr6Ncr($config, $container); - $this->configureDynamoDbNcr($config, $container, $config['ncr']['provider']); + $this->configurePsr6Ncr($configs, $container); + $this->configureDynamoDbNcr($configs, $container, $configs['ncr']['provider']); // ncr_cache - $container->setParameter('gdbots_ncr.ncr_cache.max_items', $config['ncr_cache']['max_items']); + $container->setParameter('gdbots_ncr.ncr_cache.max_items', $configs['ncr_cache']['max_items']); $container->setAlias(NcrCache::class, 'ncr_cache'); $container->setAlias(NcrLazyLoader::class, 'ncr_lazy_loader'); $container->setAlias(NcrPreloader::class, 'ncr_preloader'); // ncr_search - $container->setParameter('gdbots_ncr.ncr_search.provider', $config['ncr_search']['provider']); - $this->configureElasticaNcrSearch($config, $container, $config['ncr_search']['provider']); + $container->setParameter('gdbots_ncr.ncr_search.provider', $configs['ncr_search']['provider']); + $this->configureElasticaNcrSearch($configs, $container, $configs['ncr_search']['provider']); // node_idempotency_validator - $container->setParameter('gdbots_ncr.node_idempotency_validator.ttl', $config['node_idempotency_validator']['ttl']); + $container->setParameter('gdbots_ncr.node_idempotency_validator.ttl', $configs['node_idempotency_validator']['ttl']); } - protected function configurePsr6Ncr(array $config, ContainerBuilder $container): void + protected function configurePsr6Ncr(array $configs, ContainerBuilder $container): void { $service = 'gdbots_ncr.ncr.psr6'; - $psr6 = $config['ncr']['psr6']; + $psr6 = $configs['ncr']['psr6']; if (!$psr6['enabled']) { $container->removeDefinition($service); @@ -72,17 +72,17 @@ protected function configurePsr6Ncr(array $config, ContainerBuilder $container): } } - protected function configureDynamoDbNcr(array $config, ContainerBuilder $container, ?string $provider): void + protected function configureDynamoDbNcr(array $configs, ContainerBuilder $container, ?string $provider): void { $service = 'gdbots_ncr.ncr.dynamodb'; - if (!isset($config['ncr']['dynamodb']) || 'dynamodb' !== $provider) { + if (!isset($configs['ncr']['dynamodb']) || 'dynamodb' !== $provider) { $container->removeDefinition($service); $container->removeDefinition("{$service}.table_manager"); return; } - $dynamodb = $config['ncr']['dynamodb']; + $dynamodb = $configs['ncr']['dynamodb']; $container->setParameter("{$service}.class", $dynamodb['class']); $container->setParameter("{$service}.table_manager.class", $dynamodb['table_manager']['class']); $container->setParameter("{$service}.table_manager.table_name_prefix", $dynamodb['table_manager']['table_name_prefix']); @@ -96,18 +96,18 @@ protected function configureDynamoDbNcr(array $config, ContainerBuilder $contain $container->setAlias(Ncr::class, 'ncr'); } - protected function configureElasticaNcrSearch(array $config, ContainerBuilder $container, ?string $provider): void + protected function configureElasticaNcrSearch(array $configs, ContainerBuilder $container, ?string $provider): void { $service = 'gdbots_ncr.ncr_search.elastica'; - if (!isset($config['ncr_search']['elastica']) || 'elastica' !== $provider) { + if (!isset($configs['ncr_search']['elastica']) || 'elastica' !== $provider) { $container->removeDefinition($service); $container->removeDefinition("{$service}.client_manager"); $container->removeDefinition("{$service}.index_manager"); return; } - $elastica = $config['ncr_search']['elastica']; + $elastica = $configs['ncr_search']['elastica']; $container->setParameter("{$service}.class", $elastica['class']); $container->setParameter("{$service}.index_manager.class", $elastica['index_manager']['class']); $container->setParameter("{$service}.index_manager.index_prefix", $elastica['index_manager']['index_prefix']); diff --git a/src/GdbotsNcrBundle.php b/src/GdbotsNcrBundle.php index d594bab..186ccc2 100644 --- a/src/GdbotsNcrBundle.php +++ b/src/GdbotsNcrBundle.php @@ -15,7 +15,7 @@ public function getPath(): string return \dirname(__DIR__); } - public function build(ContainerBuilder $container) + public function build(ContainerBuilder $container): void { parent::build($container); $container->addCompilerPass(new ValidateNcrPass());