| Conditions | 6 |
| Paths | 4 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function validate($value) { |
||
| 25 | if (null === $value || '' === $value) { |
||
| 26 | return; |
||
| 27 | } |
||
| 28 | if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { |
||
| 29 | throw new ValidatorException('This value can not be converted to string'); |
||
| 30 | } |
||
| 31 | $value = (string) $value; |
||
| 32 | return $this->match xor preg_match($this->ref, $value); |
||
| 33 | } |
||
| 34 | |||
| 44 |