fix new phpstan issues

This commit is contained in:
2023-04-11 13:04:08 +02:00
parent 841bdb0ebf
commit 4db1ff405e
7 changed files with 29 additions and 44 deletions

View File

@@ -113,27 +113,23 @@ class EventSearch extends AbstractSearch
]
);
}
// format is "json"
$results = [];
$search = $this->search($terms, $start, $limit, $options);
if ('json' === $format) {
$results = [];
$search = $this->search($terms, $start, $limit, $options);
foreach ($search as $item) {
$results[] = [
'id' => $item->getId(),
'text' => $item->getDate()->format('d/m/Y, H:i') . ' → ' .
// $item->getType()->getName()['fr'] . ': ' . // display the type of event
$item->getName(),
];
}
return [
'results' => $results,
'pagination' => [
'more' => $paginator->hasNextPage(),
],
foreach ($search as $item) {
$results[] = [
'id' => $item->getId(),
'text' => $item->getDate()->format('d/m/Y, H:i') . ' → ' .
// $item->getType()->getName()['fr'] . ': ' . // display the type of event
$item->getName(),
];
}
return [
'results' => $results,
'more' => $paginator->hasNextPage(),
];
}
public function supports($domain, $format)