| Total Complexity | 3 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | trait Conditions |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var string[] list of condition expressions to apply to the WHERE clause |
||
| 14 | */ |
||
| 15 | protected array $conditions = []; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param string|string[] $exprs one or more condition expressions to apply to the WHERE clause |
||
| 19 | * |
||
| 20 | * @return $this |
||
| 21 | */ |
||
| 22 | 1 | public function where(string|array $exprs): static |
|
| 23 | { |
||
| 24 | 1 | foreach ((array) $exprs as $expr) { |
|
| 25 | 1 | $this->conditions[] = $expr; |
|
| 26 | } |
||
| 27 | |||
| 28 | 1 | return $this; |
|
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @return string combined condition expression (for use in the WHERE clause of an SQL statement) |
||
| 33 | */ |
||
| 34 | 1 | protected function buildConditions(): string |
|
| 37 | } |
||
| 38 | } |
||
| 39 |