Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
luilliarcec authored and github-actions[bot] committed Apr 9, 2024
1 parent c087611 commit ea8e3c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/Filters/GlobalFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Illuminate\Contracts\Database\Query\Expression;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Collection;
use Kirschbaum\PowerJoins\FakeJoinCallback;
use Spatie\QueryBuilder\AllowedFilter;
use Spatie\QueryBuilder\Filters\Filter;
use TeamQ\QueryBuilder\Concerns\HasPropertyRelationship;
Expand Down Expand Up @@ -34,7 +33,7 @@ class GlobalFilter implements Filter
public function __construct(
array $fields,
bool $addRelationConstraint = true,
JoinType $joinType = null,
?JoinType $joinType = null,
array|string|null $joinAliases = null
) {
$this->fields = $fields;
Expand All @@ -49,7 +48,7 @@ public function __construct(
public static function allowed(
array $fields,
bool $addRelationConstraint = true,
JoinType $joinType = null,
?JoinType $joinType = null,
string $name = 'global',
): AllowedFilter {
return AllowedFilter::custom($name, new static($fields, $addRelationConstraint, $joinType));
Expand Down
4 changes: 2 additions & 2 deletions tests/Sorts/RelationSortTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
]);

expect($queryBuilder->toSql())
->toBe("select `books`.*, sum(chapters_alias.number) as chapters_alias_number_sum from `books` left join `chapters` as `chapters_alias` on `chapters_alias`.`book_id` = `books`.`id` group by `books`.`id` order by chapters_alias_number_sum desc")
->toBe('select `books`.*, sum(chapters_alias.number) as chapters_alias_number_sum from `books` left join `chapters` as `chapters_alias` on `chapters_alias`.`book_id` = `books`.`id` group by `books`.`id` order by chapters_alias_number_sum desc')
->and($queryBuilder->get())
->sequence(
fn ($book) => $book->title->toBe('Laravel Beyond Crud'),
Expand All @@ -194,7 +194,7 @@
]);

expect($queryBuilder->toSql())
->toBe("select `countries`.* from `countries` inner join `authors` as `authors_alias` on `authors_alias`.`country_id` = `countries`.`id` inner join `books` as `books_alias` on `books_alias`.`author_id` = `authors_alias`.`id` order by `books_alias`.`order` asc")
->toBe('select `countries`.* from `countries` inner join `authors` as `authors_alias` on `authors_alias`.`country_id` = `countries`.`id` inner join `books` as `books_alias` on `books_alias`.`author_id` = `authors_alias`.`id` order by `books_alias`.`order` asc')
->and($queryBuilder->get())
->sequence(
fn ($country) => $country->code->toBe('US'),
Expand Down

0 comments on commit ea8e3c5

Please sign in to comment.