| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | public function match($value) |
||
| 42 | { |
||
| 43 | if (false === is_string($value)) { |
||
| 44 | $this->error = sprintf("Match expander require \"string\", got \"%s\".", new StringConverter($value)); |
||
| 45 | |||
| 46 | return false; |
||
| 47 | } |
||
| 48 | |||
| 49 | if (1 !== preg_match($this->pattern, $value)) { |
||
| 50 | $this->error = sprintf("string \"%s\" don't match pattern %s.", $value, $this->pattern); |
||
| 51 | |||
| 52 | return false; |
||
| 53 | } |
||
| 54 | |||
| 55 | return true; |
||
| 56 | } |
||
| 57 | |||
| 66 |