Skip to content

Commit d935537

Browse files
committed
Code review fixes - mostly FQCN
1 parent e2bc6e4 commit d935537

File tree

5 files changed

+10
-14
lines changed

5 files changed

+10
-14
lines changed

src/lib/Event/ContentService.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,8 @@ public function deleteContent(ContentInfo $contentInfo): iterable
133133
? $beforeEvent->getLocations()
134134
: $this->innerService->deleteContent($contentInfo);
135135

136-
if (!is_array($locations)) {
137-
$locations = iterator_to_array($locations);
138-
}
139-
140136
$this->eventDispatcher->dispatch(
141-
new DeleteContentEvent($locations, ...$eventData)
137+
new DeleteContentEvent(iterator_to_array($locations), ...$eventData)
142138
);
143139

144140
return $locations;

src/lib/Persistence/Cache/TrashHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function trashSubtree($locationId)
3636

3737
$location = $this->persistenceHandler->locationHandler()->load($locationId);
3838
$limit = $this->persistenceHandler->contentHandler()->countRelations(
39-
$location->contentId,
39+
$location->contentId
4040
);
4141

4242
$reverseRelations = $this->persistenceHandler->contentHandler()->loadRelationList(
@@ -79,7 +79,7 @@ public function recover($trashedId, $newParentId)
7979
$location = $this->persistenceHandler->locationHandler()->load($return);
8080

8181
$limit = $this->persistenceHandler->contentHandler()->countRelations(
82-
$location->contentId,
82+
$location->contentId
8383
);
8484

8585
$reverseRelations = $this->persistenceHandler->contentHandler()->loadRelationList(

src/lib/Repository/Helper/RelationProcessor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function processFieldRelations(
190190
switch ($relationType) {
191191
case Relation::FIELD:
192192
case Relation::ASSET:
193-
/** @phpstan-var array<int, Relation> $relationEntry */
193+
/** @phpstan-var array<int, \Ibexa\Core\Repository\Values\Content\Relation> $relationEntry */
194194
foreach ($relationEntry as $relation) {
195195
$this->persistenceHandler->contentHandler()->removeRelation(
196196
$relation->id,
@@ -201,7 +201,7 @@ public function processFieldRelations(
201201
break;
202202
case Relation::LINK:
203203
case Relation::EMBED:
204-
/** @phpstan-var Relation $relationEntry */
204+
/** @phpstan-var \Ibexa\Core\Repository\Values\Content\Relation $relationEntry */
205205
$this->persistenceHandler->contentHandler()->removeRelation(
206206
$relationEntry->id,
207207
$relationType,

src/lib/Repository/Permission/CachedPermissionService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class CachedPermissionService implements PermissionService
5252
*
5353
* Value is null if not yet set or cleared.
5454
*
55-
* @var null|bool|\Ibexa\Contracts\Core\Repository\Values\Content\Query\CriterionInterface
55+
* @var bool|\Ibexa\Contracts\Core\Repository\Values\Content\Query\CriterionInterface|null
5656
*/
5757
private $permissionCriterion;
5858

tests/integration/Core/Repository/SearchServiceTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4864,19 +4864,19 @@ protected function simplifySearchResult(SearchResult $result)
48644864
case $hit->valueObject instanceof Location:
48654865
/** @phpstan-ignore assign.propertyType */
48664866
$hit->valueObject = [
4867-
/** @phpstan-var Location|Content $hit->valueObject */
4867+
/** @phpstan-var \Ibexa\Contracts\Core\Repository\Values\Content\Location|\Ibexa\Contracts\Core\Repository\Values\Content\Content $hit->valueObject */
48684868
'id' => $hit->valueObject->contentInfo->getId(),
4869-
/** @phpstan-var Location|Content $hit->valueObject */
4869+
/** @phpstan-var \Ibexa\Contracts\Core\Repository\Values\Content\Location|\Ibexa\Contracts\Core\Repository\Values\Content\Content $hit->valueObject */
48704870
'title' => $hit->valueObject->contentInfo->getName(),
48714871
];
48724872
break;
48734873

48744874
case $hit->valueObject instanceof ContentInfo:
48754875
/** @phpstan-ignore assign.propertyType */
48764876
$hit->valueObject = [
4877-
/** @phpstan-var ContentInfo $hit->valueObject */
4877+
/** @phpstan-var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $hit->valueObject */
48784878
'id' => $hit->valueObject->id,
4879-
/** @phpstan-var ContentInfo $hit->valueObject */
4879+
/** @phpstan-var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $hit->valueObject */
48804880
'title' => $hit->valueObject->name,
48814881
];
48824882
break;

0 commit comments

Comments
 (0)