| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3.0261 |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | 127 | public static function fromArrayDefinition(string $operator, array $operands): self |
|
| 43 | { |
||
| 44 | 127 | if (!isset($operands[0], $operands[1])) { |
|
| 45 | throw new InvalidArgumentException("Operator '$operator' requires two operands."); |
||
| 46 | } |
||
| 47 | |||
| 48 | 127 | $condition = new static($operands[0], $operator, $operands[1]); |
|
| 49 | |||
| 50 | 127 | if (isset($operands[2])) { |
|
| 51 | 5 | $condition->escapingReplacements = $operands[2]; |
|
| 52 | } |
||
| 53 | |||
| 54 | 127 | return $condition; |
|
| 55 | } |
||
| 57 |