Conditions | 5 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
38 | public function check($value = null): bool |
||
39 | { |
||
40 | if (is_null($value) && $this->nullable) { |
||
41 | return true; |
||
42 | } |
||
43 | |||
44 | if (!isset($this->against)) |
||
45 | throw new ValidationException(self::ERROR_NO_MATCH); |
||
46 | |||
47 | if ($value === $this->against) { |
||
48 | return true; |
||
49 | } |
||
50 | |||
51 | return false; |
||
52 | } |
||
54 |