Skip to content

Commit

Permalink
Fix PHPStan issues (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
zingimmick authored Nov 5, 2024
1 parent da53c67 commit 5a80bde
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Engines/OpenSearchEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ public function delete($models): void

/**
* Perform the given search on the engine.
*
* @param \Laravel\Scout\Builder<covariant \Illuminate\Database\Eloquent\Model> $builder
*/
public function search(Builder $builder): mixed
{
Expand All @@ -123,6 +125,7 @@ public function search(Builder $builder): mixed
*
* @param int $perPage
* @param int $page
* @param \Laravel\Scout\Builder<covariant \Illuminate\Database\Eloquent\Model> $builder
*/
public function paginate(Builder $builder, $perPage, $page): mixed
{
Expand All @@ -136,6 +139,7 @@ public function paginate(Builder $builder, $perPage, $page): mixed
* Perform the given search on the engine.
*
* @param array<string, mixed> $options
* @param \Laravel\Scout\Builder<covariant \Illuminate\Database\Eloquent\Model> $builder
*/
protected function performSearch(Builder $builder, array $options = []): mixed
{
Expand All @@ -149,6 +153,8 @@ protected function performSearch(Builder $builder, array $options = []): mixed
}

$query = $builder->query;

/** @var \Illuminate\Support\Collection<int, array{query_string?: array{query: string, term?: array<string, mixed>}}> $must */
$must = collect([
[
'query_string' => [
Expand Down Expand Up @@ -221,6 +227,7 @@ public function mapIds($results): Collection
*
* @param array{hits: mixed[]|null}|null $results
* @param \Illuminate\Database\Eloquent\Model $model
* @param \Laravel\Scout\Builder<covariant \Illuminate\Database\Eloquent\Model> $builder
*
* @return \Illuminate\Database\Eloquent\Collection<int, \Illuminate\Database\Eloquent\Model>
*/
Expand Down Expand Up @@ -252,6 +259,7 @@ public function map(Builder $builder, $results, $model): mixed
*
* @param array{hits: mixed[]|null}|null $results
* @param \Illuminate\Database\Eloquent\Model $model
* @param \Laravel\Scout\Builder<covariant \Illuminate\Database\Eloquent\Model> $builder
*
* @return \Illuminate\Support\LazyCollection<int, \Illuminate\Database\Eloquent\Model>
*/
Expand Down

0 comments on commit 5a80bde

Please sign in to comment.