From aa5293c76ab07a25e4663151f591d2fa1cfb1c14 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Wed, 11 Dec 2024 15:35:45 +0100 Subject: [PATCH] Improved strictness of IbexaSolrExtension constants --- .../IbexaSolrExtension.php | 51 ++++++------------- 1 file changed, 15 insertions(+), 36 deletions(-) diff --git a/src/bundle/DependencyInjection/IbexaSolrExtension.php b/src/bundle/DependencyInjection/IbexaSolrExtension.php index 8bb5757..c70f169 100644 --- a/src/bundle/DependencyInjection/IbexaSolrExtension.php +++ b/src/bundle/DependencyInjection/IbexaSolrExtension.php @@ -11,6 +11,7 @@ use Ibexa\Bundle\Solr\ApiLoader\SolrEngineFactory; use Ibexa\Solr\FieldMapper\BoostFactorProvider; use Ibexa\Solr\Gateway\DistributionStrategy\CloudDistributionStrategy; +use Ibexa\Solr\Gateway\Endpoint; use Ibexa\Solr\Gateway\UpdateSerializerInterface; use Ibexa\Solr\Handler; use Symfony\Component\Config\Definition\ConfigurationInterface; @@ -30,67 +31,45 @@ class IbexaSolrExtension extends ConfigurableExtension /** * Main Solr search handler service ID. * - * @var string + * @phpstan-var class-string */ - public const ENGINE_ID = Handler::class; + public const string ENGINE_ID = Handler::class; /** * Configured core gateway service ID. * * Not using service alias since alias can't be passed for decoration. - * - * @var string */ - public const GATEWAY_ID = 'ibexa.solr.gateway.native'; + public const string GATEWAY_ID = 'ibexa.solr.gateway.native'; /** * Configured core filter service ID. * * Not using service alias since alias can't be passed for decoration. - * - * @var string */ - public const CORE_FILTER_ID = 'ibexa.solr.core_filter.native'; + public const string CORE_FILTER_ID = 'ibexa.solr.core_filter.native'; /** * Configured core endpoint resolver service ID. * * Not using service alias since alias can't be passed for decoration. - * - * @var string */ - public const ENDPOINT_RESOLVER_ID = 'ibexa.solr.gateway.endpoint_resolver.native'; + public const string ENDPOINT_RESOLVER_ID = 'ibexa.solr.gateway.endpoint_resolver.native'; - /** - * Endpoint class. - * - * @var string - */ - public const ENDPOINT_CLASS = 'Ibexa\\Solr\\Gateway\\Endpoint'; + /** @phpstan-var class-string */ + public const string ENDPOINT_CLASS = Endpoint::class; - /** - * Endpoint service tag. - * - * @var string - */ - public const ENDPOINT_TAG = 'ibexa.search.solr.endpoint'; + public const string ENDPOINT_TAG = 'ibexa.search.solr.endpoint'; - /** - * @var string - */ - public const BOOST_FACTOR_PROVIDER_ID = BoostFactorProvider::class; + /** @phpstan-var class-string */ + public const string BOOST_FACTOR_PROVIDER_ID = BoostFactorProvider::class; - /** - * @var string - */ - public const STANDALONE_DISTRIBUTION_STRATEGY_ID = 'ibexa.solr.gateway.distribution_strategy.abstract_standalone'; + public const string STANDALONE_DISTRIBUTION_STRATEGY_ID = 'ibexa.solr.gateway.distribution_strategy.abstract_standalone'; - /** - * @var string - */ - public const CLOUD_DISTRIBUTION_STRATEGY_ID = CloudDistributionStrategy::class; + /** @phpstan-var class-string */ + public const string CLOUD_DISTRIBUTION_STRATEGY_ID = CloudDistributionStrategy::class; - public const GATEWAY_UPDATE_SERIALIZER_TAG = 'ibexa.solr.gateway.serializer.update'; + public const string GATEWAY_UPDATE_SERIALIZER_TAG = 'ibexa.solr.gateway.serializer.update'; public function getAlias(): string {