Skip to content

Commit

Permalink
Move $items closer to context
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Aug 9, 2024
1 parent bd15fbc commit e7e6555
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Controller/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ public function search(Request $request, SearchFormBuilderInterface $searchFormB

$index = $this->indexRegistry->get($this->searchIndex);

$items = [];

$searchResult = $this->client->index($this->indexNameResolver->resolve($index))->search($q, [
'facets' => $this->getFacets($index->document),
'filter' => $filterBuilder->build($request),
Expand All @@ -64,6 +62,8 @@ public function search(Request $request, SearchFormBuilderInterface $searchFormB

dump($searchResult);

Check failure on line 63 in src/Controller/SearchController.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (PHP8.1 | Deps: highest | SF~6.4.0)

ForbiddenCode

src/Controller/SearchController.php:63:9: ForbiddenCode: You have forbidden the use of dump (see https://psalm.dev/002)

Check failure on line 63 in src/Controller/SearchController.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (PHP8.2 | Deps: highest | SF~5.4.0)

ForbiddenCode

src/Controller/SearchController.php:63:9: ForbiddenCode: You have forbidden the use of dump (see https://psalm.dev/002)

Check failure on line 63 in src/Controller/SearchController.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (PHP8.2 | Deps: highest | SF~6.4.0)

ForbiddenCode

src/Controller/SearchController.php:63:9: ForbiddenCode: You have forbidden the use of dump (see https://psalm.dev/002)

Check failure on line 63 in src/Controller/SearchController.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (PHP8.2 | Deps: lowest | SF~6.4.0)

ForbiddenCode

src/Controller/SearchController.php:63:9: ForbiddenCode: You have forbidden the use of dump (see https://psalm.dev/002)

Check failure on line 63 in src/Controller/SearchController.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (PHP8.2 | Deps: lowest | SF~5.4.0)

ForbiddenCode

src/Controller/SearchController.php:63:9: ForbiddenCode: You have forbidden the use of dump (see https://psalm.dev/002)

Check failure on line 63 in src/Controller/SearchController.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (PHP8.1 | Deps: lowest | SF~5.4.0)

ForbiddenCode

src/Controller/SearchController.php:63:9: ForbiddenCode: You have forbidden the use of dump (see https://psalm.dev/002)

Check failure on line 63 in src/Controller/SearchController.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis (PHP8.1 | Deps: lowest | SF~6.4.0)

ForbiddenCode

src/Controller/SearchController.php:63:9: ForbiddenCode: You have forbidden the use of dump (see https://psalm.dev/002)

$items = [];

/** @var array{entityClass: class-string<IndexableInterface>, entityId: mixed} $hit */
foreach ($searchResult->getHits() as $hit) {
$items[] = $this->getManager($hit['entityClass'])->find($hit['entityClass'], $hit['entityId']);
Expand Down

0 comments on commit e7e6555

Please sign in to comment.