Skip to content

Commit

Permalink
Bump zing/coding-standard to ^6.1 (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
zingimmick authored Feb 21, 2022
1 parent b600615 commit 73f5c58
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
10 changes: 5 additions & 5 deletions src/Engines/OpenSearchEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion tests/SearchableModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*/
class SearchableModel extends Model
{
use SoftDeletes;
use Searchable;
use SoftDeletes;

public function searchableAs(): string
{
Expand Down

0 comments on commit 73f5c58

Please sign in to comment.