| Total Complexity | 4 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | final class In implements FilterInterface |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var bool[]|float[]|int[]|string[] Values to check against. |
||
| 17 | */ |
||
| 18 | private array $values; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param string $field Name of the field to compare. |
||
| 22 | * @param bool[]|float[]|int[]|string[] $values Values to check against. |
||
| 23 | */ |
||
| 24 | 9 | public function __construct(private string $field, array $values) |
|
| 25 | { |
||
| 26 | 9 | foreach ($values as $value) { |
|
| 27 | 9 | FilterAssert::isScalar($value); |
|
| 28 | } |
||
| 29 | 5 | $this->values = $values; |
|
| 30 | } |
||
| 31 | |||
| 32 | 5 | public function toCriteriaArray(): array |
|
| 33 | { |
||
| 34 | 5 | return [self::getOperator(), $this->field, $this->values]; |
|
| 35 | } |
||
| 36 | |||
| 37 | 107 | public static function getOperator(): string |
|
| 40 | } |
||
| 41 | } |
||
| 42 |