Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
6 / 6 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| Nullable | |
100.00% |
6 / 6 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| create | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
1 | |||
| filter | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Projom\Storage\SQL\Component\Filter; |
| 6 | |
| 7 | use Projom\Storage\SQL\Component\Column; |
| 8 | use Projom\Storage\SQL\Util\Operator; |
| 9 | |
| 10 | class Nullable |
| 11 | { |
| 12 | public static function create(Column $column, Operator $operator): array |
| 13 | { |
| 14 | $filter = static::filter($column, $operator); |
| 15 | |
| 16 | return [ |
| 17 | $filter, |
| 18 | [] |
| 19 | ]; |
| 20 | } |
| 21 | |
| 22 | public static function filter(Column $column, Operator $operator): string |
| 23 | { |
| 24 | return "$column {$operator->value}"; |
| 25 | } |
| 26 | } |