| Conditions | 3 |
| Paths | 3 |
| Total Lines | 8 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | 3 | public function validate($value): bool |
|
| 18 | { |
||
| 19 | 3 | if (preg_match('/([^\s]+)\s(.*)/i', strval($this->base), $matches)) { |
|
| 20 | 2 | return $this->compare($value, $matches[1], $matches[2]); |
|
| 21 | 2 | } elseif(preg_match('/(<|>|<=|>=|=|==)(.*)/i', strval($this->base), $matches)) { |
|
| 22 | 1 | return $this->compare($value, $matches[1], $matches[2]); |
|
| 23 | } else { |
||
| 24 | 1 | throw new TableException('Unrecognized expression pattern'); |
|
| 25 | } |
||
| 57 |