diff --git a/composer.json b/composer.json index 5cddd78..7a8aa85 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "orchestra/testbench": "^4.0 || ^5.0 || ^6.0 || ^7.0", "phpstan/phpstan-mockery": "^1.0", "phpunit/phpunit": "^8.0,<8.5.12 || ^9.3.3", - "zing/coding-standard": "^5.2 || ^6.0" + "zing/coding-standard": "^6.1" }, "autoload": { "psr-4": { diff --git a/src/Engines/OpenSearchEngine.php b/src/Engines/OpenSearchEngine.php index b9e98ee..b8442e9 100644 --- a/src/Engines/OpenSearchEngine.php +++ b/src/Engines/OpenSearchEngine.php @@ -169,11 +169,11 @@ public function paginate(Builder $builder, $perPage, $page) protected function performSearch(Builder $builder, array $options = []) { if ($builder->callback !== null) { - return call_user_func($builder->callback, $this->search, $builder->query, $options); + return \call_user_func($builder->callback, $this->search, $builder->query, $options); } $query = $options['query']; - $options['query'] = is_string($query) ? sprintf("'%s'", $query) : $query; + $options['query'] = \is_string($query) ? sprintf("'%s'", $query) : $query; $searchParamsBuilder = new SearchParamsBuilder($options); if (empty($builder->orders)) { $searchParamsBuilder->addSort('id', SearchParamsBuilder::SORT_DECREASE); @@ -239,7 +239,7 @@ public function map(Builder $builder, $results, $model) return $model->getScoutModelsByIds($builder, $objectIds) ->filter(function ($model) use ($objectIds): bool { - return in_array($model->getScoutKey(), $objectIds, false); + return \in_array($model->getScoutKey(), $objectIds, false); })->sortBy(function ($model) use ($objectIdPositions): int { return $objectIdPositions[$model->getScoutKey()]; })->values(); @@ -273,7 +273,7 @@ public function lazyMap(Builder $builder, $results, $model) return $model->queryScoutModelsByIds($builder, $objectIds) ->cursor() ->filter(function ($model) use ($objectIds): bool { - return in_array($model->getScoutKey(), $objectIds, false); + return \in_array($model->getScoutKey(), $objectIds, false); })->sortBy(function ($model) use ($objectIdPositions): int { return $objectIdPositions[$model->getScoutKey()]; })->values(); @@ -322,6 +322,6 @@ public function deleteIndex($name): OpenSearchResult */ protected function usesSoftDelete(Model $model): bool { - return in_array(SoftDeletes::class, class_uses_recursive($model), true); + return \in_array(SoftDeletes::class, class_uses_recursive($model), true); } } diff --git a/tests/SearchableModel.php b/tests/SearchableModel.php index 72946e8..cf43a33 100644 --- a/tests/SearchableModel.php +++ b/tests/SearchableModel.php @@ -13,8 +13,8 @@ */ class SearchableModel extends Model { - use SoftDeletes; use Searchable; + use SoftDeletes; public function searchableAs(): string {