| Conditions | 5 |
| Paths | 7 |
| Total Lines | 22 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | public function match($value, $pattern) |
||
| 34 | { |
||
| 35 | foreach ($this->matchers as $propertyMatcher) { |
||
| 36 | if ($propertyMatcher->canMatch($pattern)) { |
||
| 37 | if (true === $propertyMatcher->match($value, $pattern)) { |
||
| 38 | return true; |
||
| 39 | } |
||
| 40 | |||
| 41 | $this->error = $propertyMatcher->getError(); |
||
| 42 | } |
||
| 43 | } |
||
| 44 | |||
| 45 | if (!isset($this->error)) { |
||
| 46 | $this->error = sprintf( |
||
| 47 | 'Any matcher from chain can\'t match value "%s" to pattern "%s"', |
||
| 48 | new StringConverter($value), |
||
| 49 | new StringConverter($pattern) |
||
| 50 | ); |
||
| 51 | } |
||
| 52 | |||
| 53 | return false; |
||
| 54 | } |
||
| 55 | |||
| 64 |