diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 00000000..4ba28536 --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,25 @@ +withRules([ + 'declare_strict_types' => false, +]); + +return $configFactory + ->buildConfig() + ->setFinder( + PhpCsFixer\Finder::create() + ->in([ + __DIR__ . '/src', + __DIR__ . '/tests', + ]) + ->files()->name('*.php') + ); diff --git a/.php_cs b/.php_cs deleted file mode 100644 index 2e63f5b1..00000000 --- a/.php_cs +++ /dev/null @@ -1,9 +0,0 @@ -setFinder( - PhpCsFixer\Finder::create() - ->in(__DIR__ . '/lib') - ->in(__DIR__ . '/bundle') - ->in(__DIR__ . '/tests') - ->files()->name('*.php') -); diff --git a/composer.json b/composer.json index 28a8f52c..dd6b2c8e 100644 --- a/composer.json +++ b/composer.json @@ -13,9 +13,9 @@ } ], "require": { - "php": "^7.3", + "php": "^7.4", "ext-json": "*", - "ezsystems/ezplatform-kernel": "^4.0@dev", + "ibexa/core": "^4.0@dev", "netgen/query-translator": "^1.0.2", "symfony/http-kernel": "^5.0", "symfony/dependency-injection": "^5.0", @@ -24,10 +24,10 @@ "symfony/framework-bundle": "^5.0" }, "require-dev": { - "ezsystems/doctrine-dbal-schema": "^4.0@dev", + "ibexa/doctrine-schema": "^4.0@dev", "phpunit/phpunit": "^8.2", "matthiasnoback/symfony-dependency-injection-test": "^4.1", - "ezsystems/ezplatform-code-style": "^0.1.0" + "ibexa/code-style": "^1.0" }, "autoload": { "psr-4": { @@ -51,8 +51,8 @@ } }, "scripts": { - "fix-cs": "php-cs-fixer fix -v --show-progress=estimating", - "check-cs": "php-cs-fixer fix --dry-run -v --show-progress=estimating" + "fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots", + "check-cs": "php-cs-fixer fix --dry-run -v --show-progress=dots" }, "extra": { "branch-alias": { diff --git a/src/bundle/ApiLoader/BoostFactorProviderFactory.php b/src/bundle/ApiLoader/BoostFactorProviderFactory.php index 5866760c..e8e9d335 100644 --- a/src/bundle/ApiLoader/BoostFactorProviderFactory.php +++ b/src/bundle/ApiLoader/BoostFactorProviderFactory.php @@ -1,14 +1,12 @@ prototype('array') ->beforeNormalization() ->ifTrue( - function ($v) { + static function ($v) { return !empty($v['mapping']) && !\is_array($v['mapping']) ; } ) ->then( - function ($v) { + static function ($v) { // If single endpoint is set for Content mapping, use it as default // mapping for Content index $v['mapping'] = [ @@ -133,7 +131,7 @@ function ($v) { ->end() ->beforeNormalization() ->ifTrue( - function ($v) { + static function ($v) { return empty($v['entry_endpoints']) && ( @@ -146,7 +144,7 @@ function ($v) { ) ->then( // If entry endpoints are not provided use mapping endpoints - function ($v) { + static function ($v) { $endpointSet = []; if (!empty($v['mapping']['translations'])) { @@ -315,7 +313,7 @@ function ($v) { ->useAttributeAsKey('content_type_identifier') ->beforeNormalization() ->always( - function (array $v) { + static function (array $v) { $valuesMapped = []; foreach ($v as $key => $value) { if (\is_array($value)) { @@ -351,7 +349,7 @@ function (array $v) { ->useAttributeAsKey('content_type_identifier') ->beforeNormalization() ->always( - function (array $v) { + static function (array $v) { $valuesMapped = []; foreach ($v as $key => $value) { if (\is_array($value)) { diff --git a/src/bundle/DependencyInjection/IbexaSolrExtension.php b/src/bundle/DependencyInjection/IbexaSolrExtension.php index d52a7bec..e1efaa3a 100644 --- a/src/bundle/DependencyInjection/IbexaSolrExtension.php +++ b/src/bundle/DependencyInjection/IbexaSolrExtension.php @@ -1,22 +1,18 @@ fieldTypeRegistry->getFieldType($fieldDefinition->fieldType); $fields[] = new Field( $name = $this->fieldNameGenerator->getName( diff --git a/src/lib/FieldMapper/ContentTranslationFieldMapper/ContentDocumentFulltextFields.php b/src/lib/FieldMapper/ContentTranslationFieldMapper/ContentDocumentFulltextFields.php index bc2b6bfe..a9144ecf 100644 --- a/src/lib/FieldMapper/ContentTranslationFieldMapper/ContentDocumentFulltextFields.php +++ b/src/lib/FieldMapper/ContentTranslationFieldMapper/ContentDocumentFulltextFields.php @@ -1,23 +1,21 @@ contentHandler->loadRelations($sourceContent->versionInfo->contentInfo->id); $relatedContents = $this->contentHandler->loadContentList( - array_map(function (Content\Relation $relation) { + array_map(static function (Content\Relation $relation) { return $relation->destinationContentId; }, $relations) ); $contentTypes = $this->contentTypeHandler->loadContentTypeList( - array_map(function (Content $content) { + array_map(static function (Content $content) { return $content->versionInfo->contentInfo->contentTypeId; }, $relatedContents) ); @@ -218,7 +216,7 @@ private function getIndexFieldName(int $depth): string /** * Return index field type for the given $contentType. * - * @return \eZ\Publish\SPI\Search\FieldType + * @return \Ibexa\Contracts\Core\Search\FieldType */ private function getIndexFieldType(ContentType $contentType) { diff --git a/src/lib/FieldMapper/ContentTranslationFieldMapper/ContentDocumentTranslatedContentNameField.php b/src/lib/FieldMapper/ContentTranslationFieldMapper/ContentDocumentTranslatedContentNameField.php index b68d98d3..7308a293 100644 --- a/src/lib/FieldMapper/ContentTranslationFieldMapper/ContentDocumentTranslatedContentNameField.php +++ b/src/lib/FieldMapper/ContentTranslationFieldMapper/ContentDocumentTranslatedContentNameField.php @@ -1,19 +1,17 @@ array("languages" => array(,..), "useAlwaysAvailable" => bool) * useAlwaysAvailable defaults to true to avoid exceptions on missing translations. * - * @return \eZ\Publish\API\Repository\Values\Content\Search\SearchResult + * @return \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult */ public function findContent(Query $query, array $languageFilter = []) { @@ -162,16 +160,16 @@ public function findContent(Query $query, array $languageFilter = []) /** * Performs a query for a single content object. * - * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException if the object was not found by the query or due to permissions - * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException if Criterion is not applicable to its target - * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException if there is more than than one result matching the criterions + * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException if the object was not found by the query or due to permissions + * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if Criterion is not applicable to its target + * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException if there is more than than one result matching the criterions * * @param array $languageFilter - a map of language related filters specifying languages query will be performed on. * Also used to define which field languages are loaded for the returned content. * Currently supports: array("languages" => array(,..), "useAlwaysAvailable" => bool) * useAlwaysAvailable defaults to true to avoid exceptions on missing translations. * - * @return \eZ\Publish\SPI\Persistence\Content + * @return \Ibexa\Contracts\Core\Persistence\Content */ public function findSingle(Criterion $filter, array $languageFilter = []) { @@ -210,7 +208,7 @@ public function findSingle(Criterion $filter, array $languageFilter = []) * Currently supports: array("languages" => array(,..), "useAlwaysAvailable" => bool) * useAlwaysAvailable defaults to true to avoid exceptions on missing translations. * - * @return \eZ\Publish\API\Repository\Values\Content\Search\SearchResult + * @return \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult */ public function findLocations(LocationQuery $query, array $languageFilter = []) { @@ -236,7 +234,7 @@ public function findLocations(LocationQuery $query, array $languageFilter = []) * @param string $prefix * @param string[] $fieldPaths * @param int $limit - * @param \eZ\Publish\API\Repository\Values\Content\Query\Criterion $filter + * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion $filter */ public function suggest($prefix, $fieldPaths = [], $limit = 10, Criterion $filter = null) { @@ -266,7 +264,7 @@ public function indexContent(Content $content) * sure we match the features of these. * See also {@see Solr\Content\Search\Gateway\Native::bulkIndexContent} for further Solr specific info. * - * @param \eZ\Publish\SPI\Persistence\Content[] $contentObjects + * @param \Ibexa\Contracts\Core\Persistence\Content[] $contentObjects */ public function bulkIndexContent(array $contentObjects) { @@ -408,7 +406,7 @@ protected function updateAllElementsWithAdditionalLocation($locationId) * * @param int $limit * - * @return Query + * @return \Ibexa\Contracts\Core\Repository\Values\Content\Query */ protected function prepareQuery($limit = self::DEFAULT_QUERY_LIMIT) { @@ -428,8 +426,11 @@ protected function prepareQuery($limit = self::DEFAULT_QUERY_LIMIT) */ protected function allItemsWithinLocation($locationId) { - return new Criterion\CustomField('location_path_string_mid', Criterion\Operator::EQ, - "/.*\\/{$locationId}\\/.*/"); + return new Criterion\CustomField( + 'location_path_string_mid', + Criterion\Operator::EQ, + "/.*\\/{$locationId}\\/.*/" + ); } /** @@ -449,7 +450,7 @@ protected function allItemsWithinLocationWithAdditionalLocation($locationId) /** * Generate search document for Content object to be indexed by a search engine. * - * @return \eZ\Publish\SPI\Search\Document + * @return \Ibexa\Contracts\Core\Search\Document */ public function generateDocument(Content $content) { @@ -464,7 +465,7 @@ public function generateDocument(Content $content) * - On large amounts of data make sure to iterate with several calls to this function with a limited * set of content objects, amount you have memory for depends on server, size of objects, & PHP version. * - * @param \eZ\Publish\SPI\Search\Document[] $documents + * @param \Ibexa\Contracts\Core\Search\Document[] $documents */ public function bulkIndexDocuments(array $documents) { diff --git a/src/lib/Indexer.php b/src/lib/Indexer.php index 158faa97..2ceb5188 100644 --- a/src/lib/Indexer.php +++ b/src/lib/Indexer.php @@ -1,24 +1,24 @@ value diff --git a/src/lib/Query/Common/CriterionVisitor/ContentTypeGroupIdIn.php b/src/lib/Query/Common/CriterionVisitor/ContentTypeGroupIdIn.php index d8e375a1..f4e08297 100644 --- a/src/lib/Query/Common/CriterionVisitor/ContentTypeGroupIdIn.php +++ b/src/lib/Query/Common/CriterionVisitor/ContentTypeGroupIdIn.php @@ -1,17 +1,13 @@ value diff --git a/src/lib/Query/Common/CriterionVisitor/ContentTypeIdentifierIn.php b/src/lib/Query/Common/CriterionVisitor/ContentTypeIdentifierIn.php index c6e0f0e5..f29df011 100644 --- a/src/lib/Query/Common/CriterionVisitor/ContentTypeIdentifierIn.php +++ b/src/lib/Query/Common/CriterionVisitor/ContentTypeIdentifierIn.php @@ -1,19 +1,15 @@ value diff --git a/src/lib/Query/Common/CriterionVisitor/LogicalAnd.php b/src/lib/Query/Common/CriterionVisitor/LogicalAnd.php index 8d10c925..aec44179 100644 --- a/src/lib/Query/Common/CriterionVisitor/LogicalAnd.php +++ b/src/lib/Query/Common/CriterionVisitor/LogicalAnd.php @@ -1,16 +1,12 @@ criteria[0])) { throw new RuntimeException('Invalid aggregation in LogicalAnd criterion.'); } $subCriteria = array_map( - function ($value) use ($subVisitor) { + static function ($value) use ($subVisitor) { return $subVisitor->visit($value); }, $criterion->criteria diff --git a/src/lib/Query/Common/CriterionVisitor/LogicalNot.php b/src/lib/Query/Common/CriterionVisitor/LogicalNot.php index 6eb6f57a..237eb5e8 100644 --- a/src/lib/Query/Common/CriterionVisitor/LogicalNot.php +++ b/src/lib/Query/Common/CriterionVisitor/LogicalNot.php @@ -1,16 +1,12 @@ criteria[0])) { throw new RuntimeException('Invalid aggregation in LogicalOr criterion.'); } $subCriteria = array_map( - function ($value) use ($subVisitor) { + static function ($value) use ($subVisitor) { return $subVisitor->visit($value); }, $criterion->criteria diff --git a/src/lib/Query/Common/CriterionVisitor/MapLocation.php b/src/lib/Query/Common/CriterionVisitor/MapLocation.php index 712d5acd..9a091616 100644 --- a/src/lib/Query/Common/CriterionVisitor/MapLocation.php +++ b/src/lib/Query/Common/CriterionVisitor/MapLocation.php @@ -1,18 +1,14 @@ valueData; $criterion->value = (array)$criterion->value; diff --git a/src/lib/Query/Common/CriterionVisitor/MapLocation/MapLocationDistanceRange.php b/src/lib/Query/Common/CriterionVisitor/MapLocation/MapLocationDistanceRange.php index 2ae49c85..ca0b0592 100644 --- a/src/lib/Query/Common/CriterionVisitor/MapLocation/MapLocationDistanceRange.php +++ b/src/lib/Query/Common/CriterionVisitor/MapLocation/MapLocationDistanceRange.php @@ -1,20 +1,16 @@ valueData; $queries = []; diff --git a/src/lib/Query/Common/CriterionVisitor/MatchAll.php b/src/lib/Query/Common/CriterionVisitor/MatchAll.php index 6518482d..befeb508 100644 --- a/src/lib/Query/Common/CriterionVisitor/MatchAll.php +++ b/src/lib/Query/Common/CriterionVisitor/MatchAll.php @@ -1,16 +1,12 @@ value diff --git a/src/lib/Query/Common/CriterionVisitor/SectionIdentifierIn.php b/src/lib/Query/Common/CriterionVisitor/SectionIdentifierIn.php index 13c0e766..1ab2ff00 100644 --- a/src/lib/Query/Common/CriterionVisitor/SectionIdentifierIn.php +++ b/src/lib/Query/Common/CriterionVisitor/SectionIdentifierIn.php @@ -1,16 +1,16 @@ value diff --git a/src/lib/Query/Common/CriterionVisitor/UserEmailIn.php b/src/lib/Query/Common/CriterionVisitor/UserEmailIn.php index 509c1fb5..7cc226c2 100644 --- a/src/lib/Query/Common/CriterionVisitor/UserEmailIn.php +++ b/src/lib/Query/Common/CriterionVisitor/UserEmailIn.php @@ -8,8 +8,8 @@ namespace Ibexa\Solr\Query\Common\CriterionVisitor; -use eZ\Publish\API\Repository\Values\Content\Query\Criterion; -use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Operator; use Ibexa\Contracts\Solr\Query\CriterionVisitor; use Ibexa\Solr\FieldMapper\ContentFieldMapper\UserDocumentFields; diff --git a/src/lib/Query/Common/CriterionVisitor/UserIdIn.php b/src/lib/Query/Common/CriterionVisitor/UserIdIn.php index f165fa64..34365833 100644 --- a/src/lib/Query/Common/CriterionVisitor/UserIdIn.php +++ b/src/lib/Query/Common/CriterionVisitor/UserIdIn.php @@ -8,8 +8,8 @@ namespace Ibexa\Solr\Query\Common\CriterionVisitor; -use eZ\Publish\API\Repository\Values\Content\Query\Criterion; -use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Operator; use Ibexa\Contracts\Solr\Query\CriterionVisitor; final class UserIdIn extends CriterionVisitor diff --git a/src/lib/Query/Common/CriterionVisitor/UserLoginIn.php b/src/lib/Query/Common/CriterionVisitor/UserLoginIn.php index fa33319f..36065a95 100644 --- a/src/lib/Query/Common/CriterionVisitor/UserLoginIn.php +++ b/src/lib/Query/Common/CriterionVisitor/UserLoginIn.php @@ -8,8 +8,8 @@ namespace Ibexa\Solr\Query\Common\CriterionVisitor; -use eZ\Publish\API\Repository\Values\Content\Query\Criterion; -use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion; +use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Operator; use Ibexa\Contracts\Solr\Query\CriterionVisitor; use Ibexa\Solr\FieldMapper\ContentFieldMapper\UserDocumentFields; diff --git a/src/lib/Query/Common/CriterionVisitor/UserMetadataIn.php b/src/lib/Query/Common/CriterionVisitor/UserMetadataIn.php index ecb09c29..c8d615db 100644 --- a/src/lib/Query/Common/CriterionVisitor/UserMetadataIn.php +++ b/src/lib/Query/Common/CriterionVisitor/UserMetadataIn.php @@ -1,18 +1,14 @@ value diff --git a/src/lib/Query/Common/FacetBuilderVisitor/Aggregate.php b/src/lib/Query/Common/FacetBuilderVisitor/Aggregate.php index ce9fb6dd..26d6244e 100644 --- a/src/lib/Query/Common/FacetBuilderVisitor/Aggregate.php +++ b/src/lib/Query/Common/FacetBuilderVisitor/Aggregate.php @@ -1,16 +1,12 @@ 'content_owner_user_id_id', UserFacetBuilder::GROUP => 'content_owner_user_group_ids_mid', UserFacetBuilder::MODIFIER => 'content_version_creator_user_id_id', @@ -58,7 +54,7 @@ public function canVisit(FacetBuilder $facetBuilder) */ public function visitBuilder(FacetBuilder $facetBuilder, $fieldId) { - /** @var \eZ\Publish\API\Repository\Values\Content\Query\FacetBuilder\UserFacetBuilder $facetBuilder */ + /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Query\FacetBuilder\UserFacetBuilder $facetBuilder */ $field = self::DOC_FIELD_MAP[$facetBuilder->type]; return [ diff --git a/src/lib/Query/Common/QueryConverter/NativeQueryConverter.php b/src/lib/Query/Common/QueryConverter/NativeQueryConverter.php index 0cbcd132..bcf1322d 100644 --- a/src/lib/Query/Common/QueryConverter/NativeQueryConverter.php +++ b/src/lib/Query/Common/QueryConverter/NativeQueryConverter.php @@ -1,21 +1,17 @@ targetData; return $targetData->fieldName . ' ' . $this->getDirection($sortClause); diff --git a/src/lib/Query/Common/SortClauseVisitor/DateModified.php b/src/lib/Query/Common/SortClauseVisitor/DateModified.php index edba74ad..588c7ad5 100644 --- a/src/lib/Query/Common/SortClauseVisitor/DateModified.php +++ b/src/lib/Query/Common/SortClauseVisitor/DateModified.php @@ -1,16 +1,12 @@ targetData; $fieldName = $this->getSortFieldName( $sortClause, diff --git a/src/lib/Query/Common/SortClauseVisitor/MapLocationDistance.php b/src/lib/Query/Common/SortClauseVisitor/MapLocationDistance.php index 6c8853bd..27cc0481 100644 --- a/src/lib/Query/Common/SortClauseVisitor/MapLocationDistance.php +++ b/src/lib/Query/Common/SortClauseVisitor/MapLocationDistance.php @@ -1,19 +1,15 @@ targetData; $fieldName = $this->getSortFieldName( $sortClause, diff --git a/src/lib/Query/Common/SortClauseVisitor/Random.php b/src/lib/Query/Common/SortClauseVisitor/Random.php index 2b3d4fc5..887032bf 100644 --- a/src/lib/Query/Common/SortClauseVisitor/Random.php +++ b/src/lib/Query/Common/SortClauseVisitor/Random.php @@ -1,15 +1,13 @@ tokenizer->tokenize($criterion->value); $syntaxTree = $this->parser->parse($tokenSequence); @@ -118,7 +114,7 @@ public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null) private function getQueryFields(Criterion $criterion) { - /** @var \eZ\Publish\API\Repository\Values\Content\Query\Criterion\FullText $criterion */ + /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\FullText $criterion */ $queryFields = ['meta_content__text_t']; for ($i = 1; $i <= $this->maxDepth; ++$i) { diff --git a/src/lib/Query/Content/CriterionVisitor/LocationIdIn.php b/src/lib/Query/Content/CriterionVisitor/LocationIdIn.php index 09a56203..0ac9db71 100644 --- a/src/lib/Query/Content/CriterionVisitor/LocationIdIn.php +++ b/src/lib/Query/Content/CriterionVisitor/LocationIdIn.php @@ -1,17 +1,13 @@ value diff --git a/src/lib/Query/Content/CriterionVisitor/LocationRemoteIdIn.php b/src/lib/Query/Content/CriterionVisitor/LocationRemoteIdIn.php index c5f7001e..f5032d31 100644 --- a/src/lib/Query/Content/CriterionVisitor/LocationRemoteIdIn.php +++ b/src/lib/Query/Content/CriterionVisitor/LocationRemoteIdIn.php @@ -1,17 +1,13 @@ value diff --git a/src/lib/Query/Content/CriterionVisitor/ParentLocationIdIn.php b/src/lib/Query/Content/CriterionVisitor/ParentLocationIdIn.php index 2127e49b..bd5ab8a8 100644 --- a/src/lib/Query/Content/CriterionVisitor/ParentLocationIdIn.php +++ b/src/lib/Query/Content/CriterionVisitor/ParentLocationIdIn.php @@ -1,17 +1,13 @@ value diff --git a/src/lib/Query/Content/CriterionVisitor/SubtreeIn.php b/src/lib/Query/Content/CriterionVisitor/SubtreeIn.php index 28d9c6e1..4e5d8655 100644 --- a/src/lib/Query/Content/CriterionVisitor/SubtreeIn.php +++ b/src/lib/Query/Content/CriterionVisitor/SubtreeIn.php @@ -1,19 +1,15 @@ value diff --git a/src/lib/Query/Content/CriterionVisitor/Visibility.php b/src/lib/Query/Content/CriterionVisitor/Visibility.php index c27c549b..de462826 100644 --- a/src/lib/Query/Content/CriterionVisitor/Visibility.php +++ b/src/lib/Query/Content/CriterionVisitor/Visibility.php @@ -1,17 +1,13 @@ value diff --git a/src/lib/Query/Location/CriterionVisitor/LocationRemoteIdIn.php b/src/lib/Query/Location/CriterionVisitor/LocationRemoteIdIn.php index 30bdd65b..fb301023 100644 --- a/src/lib/Query/Location/CriterionVisitor/LocationRemoteIdIn.php +++ b/src/lib/Query/Location/CriterionVisitor/LocationRemoteIdIn.php @@ -1,17 +1,13 @@ value diff --git a/src/lib/Query/Location/CriterionVisitor/ParentLocationIdIn.php b/src/lib/Query/Location/CriterionVisitor/ParentLocationIdIn.php index 564fb8f9..fad9a793 100644 --- a/src/lib/Query/Location/CriterionVisitor/ParentLocationIdIn.php +++ b/src/lib/Query/Location/CriterionVisitor/ParentLocationIdIn.php @@ -1,17 +1,13 @@ value diff --git a/src/lib/Query/Location/CriterionVisitor/SubtreeIn.php b/src/lib/Query/Location/CriterionVisitor/SubtreeIn.php index 231ce0d4..fa1994a6 100644 --- a/src/lib/Query/Location/CriterionVisitor/SubtreeIn.php +++ b/src/lib/Query/Location/CriterionVisitor/SubtreeIn.php @@ -1,17 +1,13 @@ value diff --git a/src/lib/Query/Location/CriterionVisitor/Visibility.php b/src/lib/Query/Location/CriterionVisitor/Visibility.php index eb262559..baef6d64 100644 --- a/src/lib/Query/Location/CriterionVisitor/Visibility.php +++ b/src/lib/Query/Location/CriterionVisitor/Visibility.php @@ -1,17 +1,13 @@ \"{!ex=dt key=\${id}}${field}\",", - E_USER_DEPRECATED); + E_USER_DEPRECATED + ); } $facets[] = $this->facetBuilderVisitor->mapField( diff --git a/src/lib/ResultExtractor/AggregationResultExtractor/DispatcherAggregationResultExtractor.php b/src/lib/ResultExtractor/AggregationResultExtractor/DispatcherAggregationResultExtractor.php index 14f9a47b..ea75d27f 100644 --- a/src/lib/ResultExtractor/AggregationResultExtractor/DispatcherAggregationResultExtractor.php +++ b/src/lib/ResultExtractor/AggregationResultExtractor/DispatcherAggregationResultExtractor.php @@ -1,26 +1,26 @@ endpointRegistry = $this->createMock(EndpointRegistry::class); $this->endpointRegistry ->method('getEndpoint') - ->willReturnCallback(function ($name) { + ->willReturnCallback(static function ($name) { return new Endpoint([ 'core' => 'collection_' . $name, ]); diff --git a/tests/lib/Search/Gateway/DistributionStrategy/StandaloneDistributionStrategyTest.php b/tests/lib/Search/Gateway/DistributionStrategy/StandaloneDistributionStrategyTest.php index 1d3b2091..9a76e03d 100644 --- a/tests/lib/Search/Gateway/DistributionStrategy/StandaloneDistributionStrategyTest.php +++ b/tests/lib/Search/Gateway/DistributionStrategy/StandaloneDistributionStrategyTest.php @@ -1,7 +1,7 @@ 'eng-gb', ]; - /** @var \EzSystems\EzPlatformSolrSearchEngine\Query\AggregationVisitor */ + /** @var \Ibexa\Contracts\Solr\Query\AggregationVisitor */ protected $visitor; - /** @var \EzSystems\EzPlatformSolrSearchEngine\Query\AggregationVisitor|\PHPUnit\Framework\MockObject\MockObject */ + /** @var \Ibexa\Contracts\Solr\Query\AggregationVisitor|\PHPUnit\Framework\MockObject\MockObject */ protected $dispatcherVisitor; protected function setUp(): void diff --git a/tests/lib/Search/Query/Common/AggregationVisitor/AggregationFieldResolver/SearchFieldAggregationFieldResolverTest.php b/tests/lib/Search/Query/Common/AggregationVisitor/AggregationFieldResolver/SearchFieldAggregationFieldResolverTest.php index 952b19e1..565b95fb 100644 --- a/tests/lib/Search/Query/Common/AggregationVisitor/AggregationFieldResolver/SearchFieldAggregationFieldResolverTest.php +++ b/tests/lib/Search/Query/Common/AggregationVisitor/AggregationFieldResolver/SearchFieldAggregationFieldResolverTest.php @@ -1,14 +1,14 @@ createMock(AggregationVisitor::class); $visitor->method('canVisit')->with($aggregation, $languageFilter)->willReturn($supports); diff --git a/tests/lib/Search/Query/Common/AggregationVisitor/ObjectStateGroupAggregationVisitorTest.php b/tests/lib/Search/Query/Common/AggregationVisitor/ObjectStateGroupAggregationVisitorTest.php index e5d718df..b71c93b8 100644 --- a/tests/lib/Search/Query/Common/AggregationVisitor/ObjectStateGroupAggregationVisitorTest.php +++ b/tests/lib/Search/Query/Common/AggregationVisitor/ObjectStateGroupAggregationVisitorTest.php @@ -1,15 +1,15 @@ getTokenizer(), diff --git a/tests/lib/Search/ResultExtractor/AggregationResultExtractor/AbstractAggregationResultExtractorTest.php b/tests/lib/Search/ResultExtractor/AggregationResultExtractor/AbstractAggregationResultExtractorTest.php index 080c77d3..61b38dd3 100644 --- a/tests/lib/Search/ResultExtractor/AggregationResultExtractor/AbstractAggregationResultExtractorTest.php +++ b/tests/lib/Search/ResultExtractor/AggregationResultExtractor/AbstractAggregationResultExtractorTest.php @@ -1,15 +1,15 @@ keyMapper = $this->createMock(RangeAggregationKeyMapper::class); $this->keyMapper ->method('map') - ->willReturnCallback(function ( + ->willReturnCallback(static function ( Aggregation $aggregation, array $languageFilter, string $key diff --git a/tests/lib/Search/ResultExtractor/AggregationResultExtractor/StatsAggregationResultExtractorTest.php b/tests/lib/Search/ResultExtractor/AggregationResultExtractor/StatsAggregationResultExtractorTest.php index f7c46b23..e88e69e6 100644 --- a/tests/lib/Search/ResultExtractor/AggregationResultExtractor/StatsAggregationResultExtractorTest.php +++ b/tests/lib/Search/ResultExtractor/AggregationResultExtractor/StatsAggregationResultExtractorTest.php @@ -1,16 +1,16 @@ keyMapper = $this->createMock(TermAggregationKeyMapper::class); $this->keyMapper ->method('map') - ->willReturnCallback(function ( + ->willReturnCallback(static function ( Aggregation $aggregation, array $languageFilter, array $keys diff --git a/tests/lib/Search/TestCase.php b/tests/lib/Search/TestCase.php index f8a54f97..00986edb 100644 --- a/tests/lib/Search/TestCase.php +++ b/tests/lib/Search/TestCase.php @@ -1,12 +1,8 @@ get('ezpublish.spi.persistence.content_handler'); return $contentHandler; @@ -110,7 +110,7 @@ private function getPersistenceContentHandler( private function getSearchHandler(ServiceContainer $serviceContainer): SolrSearchHandler { - /** @var \EzSystems\EzPlatformSolrSearchEngine\Handler $searchHandler */ + /** @var \Ibexa\Solr\Handler $searchHandler */ $searchHandler = $serviceContainer->get('ezpublish.spi.search.solr'); return $searchHandler;