Skip to content

Commit 619a8cd

Browse files
author
MateuszKolankowski
committed
Merge branch '4.6'
# Conflicts: # phpstan-baseline.neon # src/contracts/Query/CriterionVisitor.php # src/lib/Gateway/HttpClient.php # src/lib/Handler.php # src/lib/Query/Common/CriterionVisitor/Aggregate.php # src/lib/Query/Common/CriterionVisitor/BaseIsContainer.php # src/lib/Query/Common/CriterionVisitor/ContentIdIn.php # src/lib/Query/Common/CriterionVisitor/ContentTypeGroupIdIn.php # src/lib/Query/Common/CriterionVisitor/ContentTypeIdIn.php # src/lib/Query/Common/CriterionVisitor/ContentTypeIdentifierIn.php # src/lib/Query/Common/CriterionVisitor/CustomField/CustomFieldIn.php # src/lib/Query/Common/CriterionVisitor/CustomField/CustomFieldRange.php # src/lib/Query/Common/CriterionVisitor/DateMetadata/ModifiedBetween.php # src/lib/Query/Common/CriterionVisitor/DateMetadata/ModifiedIn.php # src/lib/Query/Common/CriterionVisitor/DateMetadata/PublishedBetween.php # src/lib/Query/Common/CriterionVisitor/DateMetadata/PublishedIn.php # src/lib/Query/Common/CriterionVisitor/Field.php # src/lib/Query/Common/CriterionVisitor/Field/FieldEmpty.php # src/lib/Query/Common/CriterionVisitor/Field/FieldIn.php # src/lib/Query/Common/CriterionVisitor/Field/FieldLike.php # src/lib/Query/Common/CriterionVisitor/Field/FieldRange.php # src/lib/Query/Common/CriterionVisitor/Field/FieldRelation.php # src/lib/Query/Common/CriterionVisitor/IsUserEnabled.php # src/lib/Query/Common/CriterionVisitor/LanguageCodeIn.php # src/lib/Query/Common/CriterionVisitor/LogicalAnd.php # src/lib/Query/Common/CriterionVisitor/LogicalNot.php # src/lib/Query/Common/CriterionVisitor/LogicalOr.php # src/lib/Query/Common/CriterionVisitor/MapLocation/MapLocationDistanceIn.php # src/lib/Query/Common/CriterionVisitor/MapLocation/MapLocationDistanceRange.php # src/lib/Query/Common/CriterionVisitor/MatchAll.php # src/lib/Query/Common/CriterionVisitor/MatchNone.php # src/lib/Query/Common/CriterionVisitor/ObjectStateIdIn.php # src/lib/Query/Common/CriterionVisitor/ObjectStateIdentifierIn.php # src/lib/Query/Common/CriterionVisitor/RemoteIdIn.php # src/lib/Query/Common/CriterionVisitor/SectionIdentifierIn.php # src/lib/Query/Common/CriterionVisitor/SectionIn.php # src/lib/Query/Common/CriterionVisitor/UserEmailIn.php # src/lib/Query/Common/CriterionVisitor/UserIdIn.php # src/lib/Query/Common/CriterionVisitor/UserLoginIn.php # src/lib/Query/Common/CriterionVisitor/UserMetadataIn.php # src/lib/Query/Common/FacetBuilderVisitor/Aggregate.php # src/lib/Query/Common/QueryTranslator/Generator/WordVisitor.php # src/lib/Query/Content/CriterionVisitor/Ancestor.php # src/lib/Query/Content/CriterionVisitor/ContentName.php # src/lib/Query/Content/CriterionVisitor/FullText.php # src/lib/Query/Content/CriterionVisitor/LocationIdIn.php # src/lib/Query/Content/CriterionVisitor/LocationRemoteIdIn.php # src/lib/Query/Content/CriterionVisitor/ParentLocationIdIn.php # src/lib/Query/Content/CriterionVisitor/SubtreeIn.php # src/lib/Query/Content/CriterionVisitor/Visibility.php # src/lib/Query/Image/CriterionVisitor/AbstractImageRangeVisitor.php # src/lib/Query/Image/CriterionVisitor/AbstractImageTermsVisitor.php # src/lib/Query/Location/CriterionVisitor/Ancestor.php # src/lib/Query/Location/CriterionVisitor/FullText.php # src/lib/Query/Location/CriterionVisitor/Location/DepthBetween.php # src/lib/Query/Location/CriterionVisitor/Location/DepthIn.php # src/lib/Query/Location/CriterionVisitor/Location/IsBookmarked.php # src/lib/Query/Location/CriterionVisitor/Location/IsMainLocation.php # src/lib/Query/Location/CriterionVisitor/Location/PriorityBetween.php # src/lib/Query/Location/CriterionVisitor/Location/PriorityIn.php # src/lib/Query/Location/CriterionVisitor/LocationIdIn.php # src/lib/Query/Location/CriterionVisitor/LocationRemoteIdIn.php # src/lib/Query/Location/CriterionVisitor/ParentLocationIdIn.php # src/lib/Query/Location/CriterionVisitor/SubtreeIn.php # src/lib/Query/Location/CriterionVisitor/Visibility.php # src/lib/ResultExtractor/AggregationResultExtractor/TermAggregationResultExtractor.php
2 parents 29df9ba + 6f5e270 commit 619a8cd

File tree

14 files changed

+18
-39
lines changed

14 files changed

+18
-39
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -222,24 +222,6 @@ parameters:
222222
count: 1
223223
path: src/lib/Query/Common/CriterionVisitor/LanguageCodeIn.php
224224

225-
-
226-
message: '#^Cannot call method visit\(\) on Ibexa\\Contracts\\Solr\\Query\\CriterionVisitor\|null\.$#'
227-
identifier: method.nonObject
228-
count: 1
229-
path: src/lib/Query/Common/CriterionVisitor/LogicalAnd.php
230-
231-
-
232-
message: '#^Cannot call method visit\(\) on Ibexa\\Contracts\\Solr\\Query\\CriterionVisitor\|null\.$#'
233-
identifier: method.nonObject
234-
count: 1
235-
path: src/lib/Query/Common/CriterionVisitor/LogicalNot.php
236-
237-
-
238-
message: '#^Cannot call method visit\(\) on Ibexa\\Contracts\\Solr\\Query\\CriterionVisitor\|null\.$#'
239-
identifier: method.nonObject
240-
count: 1
241-
path: src/lib/Query/Common/CriterionVisitor/LogicalOr.php
242-
243225
-
244226
message: '#^Parameter \#2 \$fieldDefinitionIdentifier of method Ibexa\\Solr\\Query\\Common\\CriterionVisitor\\MapLocation\:\:getSearchFields\(\) expects string, string\|null given\.$#'
245227
identifier: argument.type

src/lib/Handler.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,10 @@ public function findLocations(LocationQuery $query, array $languageFilter = []):
135135
}
136136

137137
/**
138-
* Suggests a list of values for the given prefix.
139-
*
140138
* @param string $prefix
141139
* @param string[] $fieldPaths
142140
*/
143-
public function suggest($prefix, $fieldPaths = [], $limit = 10, Criterion $filter = null): never
141+
public function suggest($prefix, $fieldPaths = [], $limit = 10, ?Criterion $filter = null): never
144142
{
145143
throw new \Exception('@todo: Not implemented yet.');
146144
}

src/lib/Query/Common/CriterionVisitor/Aggregate.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,9 @@ public function canVisit(CriterionInterface $criterion): bool
5353
}
5454

5555
/**
56-
* Map field value to a proper Solr representation.
57-
*
5856
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotImplementedException
5957
*/
60-
public function visit(CriterionInterface $criterion, CriterionVisitor $subVisitor = null): string
58+
public function visit(CriterionInterface $criterion, ?CriterionVisitor $subVisitor = null): string
6159
{
6260
foreach ($this->visitors as $visitor) {
6361
if ($visitor->canVisit($criterion)) {

src/lib/Query/Common/CriterionVisitor/Field/FieldEmpty.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ public function canVisit(CriterionInterface $criterion): bool
4141
}
4242

4343
/**
44-
* Map field value to a proper Solr representation.
45-
*
4644
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException If no searchable fields are found for the given criterion target.
4745
*
4846
* @param \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\IsFieldEmpty $criterion

src/lib/Query/Common/CriterionVisitor/Field/FieldIn.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ public function canVisit(CriterionInterface $criterion): bool
3434
}
3535

3636
/**
37-
* Map field value to a proper Solr representation.
38-
*
3937
* @throws \Ibexa\Core\Base\Exceptions\InvalidArgumentException If no searchable fields are found for the given criterion target.
4038
*
4139
* @param \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Field $criterion

src/lib/Query/Common/CriterionVisitor/Field/FieldLike.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ public function canVisit(CriterionInterface $criterion): bool
3030
}
3131

3232
/**
33-
* Map field value to a proper Solr representation.
34-
*
3533
* @throws \Ibexa\Core\Base\Exceptions\InvalidArgumentException If no searchable fields are found for the given criterion target.
3634
*
3735
* @param \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Field $criterion

src/lib/Query/Common/CriterionVisitor/LogicalAnd.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ public function visit(CriterionInterface $criterion, CriterionVisitor $subVisito
3737
throw new RuntimeException('Invalid aggregation in LogicalAnd criterion.');
3838
}
3939

40+
if (null === $subVisitor) {
41+
throw new RuntimeException('Sub visitor is required for LogicalAnd criterion.');
42+
}
43+
4044
$subCriteria = array_map(
4145
static fn (CriterionInterface $value): string => $subVisitor->visit($value),
4246
$criterion->criteria

src/lib/Query/Common/CriterionVisitor/LogicalNot.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion;
1111
use Ibexa\Contracts\Core\Repository\Values\Content\Query\CriterionInterface;
1212
use Ibexa\Contracts\Solr\Query\CriterionVisitor;
13+
use RuntimeException;
1314

1415
/**
1516
* Visits the LogicalNot criterion.
@@ -30,7 +31,11 @@ public function visit(CriterionInterface $criterion, ?CriterionVisitor $subVisit
3031
{
3132
if (!isset($criterion->criteria[0]) ||
3233
(\count($criterion->criteria) > 1)) {
33-
throw new \RuntimeException('Invalid aggregation in LogicalNot criterion.');
34+
throw new RuntimeException('Invalid aggregation in LogicalNot criterion.');
35+
}
36+
37+
if (null === $subVisitor) {
38+
throw new RuntimeException('Sub visitor is required for LogicalNot criterion.');
3439
}
3540

3641
return '(*:* NOT ' . $subVisitor->visit($criterion->criteria[0]) . ')';

src/lib/Query/Common/CriterionVisitor/LogicalOr.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ public function visit(CriterionInterface $criterion, ?CriterionVisitor $subVisit
3434
throw new RuntimeException('Invalid aggregation in LogicalOr criterion.');
3535
}
3636

37+
if (null === $subVisitor) {
38+
throw new RuntimeException('Sub visitor is required for LogicalOr criterion.');
39+
}
40+
3741
$subCriteria = array_map(
3842
static fn (CriterionInterface $value): string => $subVisitor->visit($value),
3943
$criterion->criteria

src/lib/Query/Common/CriterionVisitor/MapLocation/MapLocationDistanceIn.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ public function canVisit(CriterionInterface $criterion): bool
3333
}
3434

3535
/**
36-
* Map field value to a proper Solr representation.
37-
*
3836
* @throws \Ibexa\Core\Base\Exceptions\InvalidArgumentException If no searchable fields are found for the given criterion target.
3937
*
4038
* @param \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\MapLocationDistance $criterion

0 commit comments

Comments
 (0)