Skip to content

Commit

Permalink
fixed phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
konradoboza committed Jun 19, 2024
1 parent b087007 commit 3d2ef62
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/lib/DataLoader/SearchContentLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public function __construct(SearchService $searchService)
*
* @param \Ibexa\Contracts\Core\Repository\Values\Content\Query $query A Query Criterion. To use multiple criteria, group them with a LogicalAnd.
*
* @return \Ibexa\Contracts\Core\Repository\Values\Content\Content[]
*
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
*/
public function find(Query $query): array
Expand All @@ -51,15 +53,14 @@ static function (SearchHit $searchHit) {
* Loads a single content item given a Query Criterion.
*
* @param \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion $filter A Query Criterion. Use Criterion\ContentId, Criterion\RemoteId or Criterion\LocationId for basic loading.
*
* @return \Ibexa\Contracts\Core\Repository\Values\Content\Content
*
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
*/
public function findSingle(Criterion $filter): Content
{
return $this->searchService->findSingle($filter);
try {
return $this->searchService->findSingle($filter);
} catch (ApiException\NotFoundException|ApiException\InvalidArgumentException $e) {
throw new ArgumentsException($e->getMessage(), $e->getCode(), $e);
}
}

/**
Expand Down

0 comments on commit 3d2ef62

Please sign in to comment.