diff --git a/src/bundle/ApiLoader/BoostFactorProviderFactory.php b/src/bundle/ApiLoader/BoostFactorProviderFactory.php index 58298482..5b3cc283 100644 --- a/src/bundle/ApiLoader/BoostFactorProviderFactory.php +++ b/src/bundle/ApiLoader/BoostFactorProviderFactory.php @@ -8,6 +8,7 @@ use Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider; use Ibexa\Solr\FieldMapper\BoostFactorProvider; +use LogicException; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerAwareTrait; @@ -50,7 +51,7 @@ public function __construct( public function buildService() { if ($this->container === null) { - return new BoostFactorProvider(); + throw new LogicException(sprintf('Unable to build %s due to missing container reference', BoostFactorProvider::class)); } $repositoryConfig = $this->repositoryConfigurationProvider->getRepositoryConfig(); diff --git a/src/bundle/ApiLoader/IndexingDepthProviderFactory.php b/src/bundle/ApiLoader/IndexingDepthProviderFactory.php index 631e69aa..c25017bf 100644 --- a/src/bundle/ApiLoader/IndexingDepthProviderFactory.php +++ b/src/bundle/ApiLoader/IndexingDepthProviderFactory.php @@ -10,6 +10,7 @@ use Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider; use Ibexa\Solr\FieldMapper\IndexingDepthProvider; +use LogicException; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerAwareTrait; @@ -45,7 +46,7 @@ public function __construct( public function buildService() { if ($this->container === null) { - return new IndexingDepthProvider(); + throw new LogicException(sprintf('Unable to build %s due to missing container reference', IndexingDepthProvider::class)); } $repositoryConfig = $this->repositoryConfigurationProvider->getRepositoryConfig();