diff --git a/src/lib/Event/ContentService.php b/src/lib/Event/ContentService.php index 84e73b2dc8..e9f4fb9a67 100644 --- a/src/lib/Event/ContentService.php +++ b/src/lib/Event/ContentService.php @@ -133,12 +133,8 @@ public function deleteContent(ContentInfo $contentInfo): iterable ? $beforeEvent->getLocations() : $this->innerService->deleteContent($contentInfo); - if (!is_array($locations)) { - $locations = iterator_to_array($locations); - } - $this->eventDispatcher->dispatch( - new DeleteContentEvent($locations, ...$eventData) + new DeleteContentEvent(iterator_to_array($locations), ...$eventData) ); return $locations; diff --git a/src/lib/Persistence/Cache/TrashHandler.php b/src/lib/Persistence/Cache/TrashHandler.php index c040d340d6..f9a870ef0d 100644 --- a/src/lib/Persistence/Cache/TrashHandler.php +++ b/src/lib/Persistence/Cache/TrashHandler.php @@ -36,7 +36,7 @@ public function trashSubtree($locationId) $location = $this->persistenceHandler->locationHandler()->load($locationId); $limit = $this->persistenceHandler->contentHandler()->countRelations( - $location->contentId, + $location->contentId ); $reverseRelations = $this->persistenceHandler->contentHandler()->loadRelationList( @@ -79,7 +79,7 @@ public function recover($trashedId, $newParentId) $location = $this->persistenceHandler->locationHandler()->load($return); $limit = $this->persistenceHandler->contentHandler()->countRelations( - $location->contentId, + $location->contentId ); $reverseRelations = $this->persistenceHandler->contentHandler()->loadRelationList( diff --git a/src/lib/Repository/Helper/RelationProcessor.php b/src/lib/Repository/Helper/RelationProcessor.php index b82ec57195..5f9ea6af9b 100644 --- a/src/lib/Repository/Helper/RelationProcessor.php +++ b/src/lib/Repository/Helper/RelationProcessor.php @@ -190,7 +190,7 @@ public function processFieldRelations( switch ($relationType) { case Relation::FIELD: case Relation::ASSET: - /** @phpstan-var array $relationEntry */ + /** @phpstan-var array $relationEntry */ foreach ($relationEntry as $relation) { $this->persistenceHandler->contentHandler()->removeRelation( $relation->id, @@ -201,7 +201,7 @@ public function processFieldRelations( break; case Relation::LINK: case Relation::EMBED: - /** @phpstan-var Relation $relationEntry */ + /** @phpstan-var \Ibexa\Core\Repository\Values\Content\Relation $relationEntry */ $this->persistenceHandler->contentHandler()->removeRelation( $relationEntry->id, $relationType, diff --git a/src/lib/Repository/Permission/CachedPermissionService.php b/src/lib/Repository/Permission/CachedPermissionService.php index 4f29d3a5e8..36dabe0d14 100644 --- a/src/lib/Repository/Permission/CachedPermissionService.php +++ b/src/lib/Repository/Permission/CachedPermissionService.php @@ -52,7 +52,7 @@ class CachedPermissionService implements PermissionService * * Value is null if not yet set or cleared. * - * @var null|bool|\Ibexa\Contracts\Core\Repository\Values\Content\Query\CriterionInterface + * @var bool|\Ibexa\Contracts\Core\Repository\Values\Content\Query\CriterionInterface|null */ private $permissionCriterion; diff --git a/tests/integration/Core/Repository/SearchServiceTest.php b/tests/integration/Core/Repository/SearchServiceTest.php index 2687555d3d..fa547e7904 100644 --- a/tests/integration/Core/Repository/SearchServiceTest.php +++ b/tests/integration/Core/Repository/SearchServiceTest.php @@ -4864,9 +4864,9 @@ protected function simplifySearchResult(SearchResult $result) case $hit->valueObject instanceof Location: /** @phpstan-ignore assign.propertyType */ $hit->valueObject = [ - /** @phpstan-var Location|Content $hit->valueObject */ + /** @phpstan-var \Ibexa\Contracts\Core\Repository\Values\Content\Location|\Ibexa\Contracts\Core\Repository\Values\Content\Content $hit->valueObject */ 'id' => $hit->valueObject->contentInfo->getId(), - /** @phpstan-var Location|Content $hit->valueObject */ + /** @phpstan-var \Ibexa\Contracts\Core\Repository\Values\Content\Location|\Ibexa\Contracts\Core\Repository\Values\Content\Content $hit->valueObject */ 'title' => $hit->valueObject->contentInfo->getName(), ]; break; @@ -4874,9 +4874,9 @@ protected function simplifySearchResult(SearchResult $result) case $hit->valueObject instanceof ContentInfo: /** @phpstan-ignore assign.propertyType */ $hit->valueObject = [ - /** @phpstan-var ContentInfo $hit->valueObject */ + /** @phpstan-var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $hit->valueObject */ 'id' => $hit->valueObject->id, - /** @phpstan-var ContentInfo $hit->valueObject */ + /** @phpstan-var \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $hit->valueObject */ 'title' => $hit->valueObject->name, ]; break;