Skip to content

Commit 2346197

Browse files
committed
Simplify filter group and parser string assembly
1 parent 19a116f commit 2346197

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

src/Query/Filter/AndGroup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function getOperator(): string
4242
*/
4343
public function getRaw(): string
4444
{
45-
return '&'.implode(array_map(fn (Filter $filter) => (string) $filter, $this->filters));
45+
return '&'.implode($this->filters);
4646
}
4747

4848
/**

src/Query/Filter/OrGroup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function getOperator(): string
4242
*/
4343
public function getRaw(): string
4444
{
45-
return '|'.implode(array_map(fn (Filter $filter) => (string) $filter, $this->filters));
45+
return '|'.implode($this->filters);
4646
}
4747

4848
/**

src/Query/Filter/Parser.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ protected static function match(string $string): array
4848
*/
4949
public static function assemble(Filter|array $filters = []): string
5050
{
51-
return implode(array_map(
52-
fn (Filter $filter) => (string) $filter,
53-
Arr::wrap($filters)
54-
));
51+
return implode(Arr::wrap($filters));
5552
}
5653

5754
/**

0 commit comments

Comments
 (0)