Lines
100.00%
2 / 2
Methods
100.00%
2 / 2
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| dqlLike | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| 7 | abstract readonly class Filter | |
| 8 | { | |
| 9 | /** | |
| 10 | * @param array<string, scalar> $parameters | |
| 11 | */ | |
| 12 | protected function __construct( | |
| 13 | public string $where, | |
| 14 | public array $parameters, | |
| 15 | ) { | |
| 16 | } | |
| 17 | ||
| 18 | protected static function dqlLike(string $string): string | |
| 19 | { | |
| 20 | // Doctrine will handle SQL injections, we just need to escape the LIKE syntax | |
| 21 | return "%" . addcslashes($string, "%_") . "%"; | |
| 22 | } | |
| 23 | } |