Skip to content

Commit

Permalink
Refactored IbexaSolrExtension to extend ConfigurableExtension
Browse files Browse the repository at this point in the history
  • Loading branch information
alongosz committed Dec 11, 2024
1 parent 3cb5237 commit 1991874
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/bundle/DependencyInjection/IbexaSolrExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\HttpKernel\DependencyInjection\ConfigurableExtension;

/**
* @phpstan-type SolrHttpClientConfigArray = array{timeout: int, max_retries: int}
*/
class IbexaSolrExtension extends Extension
class IbexaSolrExtension extends ConfigurableExtension
{
/**
* Main Solr search handler service ID.
Expand Down Expand Up @@ -103,15 +103,13 @@ public function getServicePrefix(): string
}

/**
* @param array<string, mixed> $mergedConfig
*
* @throws \InvalidArgumentException When provided tag is not defined in this extension
* @throws \Exception
*/
public function load(array $configs, ContainerBuilder $container): void
public function loadInternal(array $mergedConfig, ContainerBuilder $container): void
{
$configuration = $this->getConfiguration($configs, $container);
assert($configuration !== null);
$config = $this->processConfiguration($configuration, $configs);

// Loading configuration from lib/Resources/config/container
$loader = new YamlFileLoader(
$container,
Expand All @@ -125,7 +123,7 @@ public function load(array $configs, ContainerBuilder $container): void
);
$loader->load('services.yml');

$this->processConnectionConfiguration($container, $config);
$this->processConnectionConfiguration($container, $mergedConfig);

$container
->registerForAutoconfiguration(UpdateSerializerInterface::class)
Expand Down

0 comments on commit 1991874

Please sign in to comment.