Skip to content

Commit 7d9b369

Browse files
Support int, float and bool values for FilterBy escape
1 parent d16028d commit 7d9b369

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/FilterBy.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44

55
class FilterBy
66
{
7-
public static function escapeString(string $value): string
7+
private function escape(string|int|float|bool $value): string
88
{
9-
return '`' . str_replace('`', '\\`', $value) . '`';
9+
return match (true) {
10+
is_string($value) => '`' . str_replace('`', '\\`', $value) . '`',
11+
is_bool($value) => $value ? 'true' : 'false',
12+
default => (string) $value,
13+
};
1014
}
1115
}

0 commit comments

Comments
 (0)