| Conditions | 4 |
| Paths | 5 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function match($value) |
||
| 40 | { |
||
| 41 | if (!is_string($value)) { |
||
| 42 | $this->error = sprintf("Contains expander require \"string\", got \"%s\".", new StringConverter($value)); |
||
| 43 | return false; |
||
| 44 | } |
||
| 45 | |||
| 46 | $contains = $this->ignoreCase |
||
| 47 | ? mb_strpos(mb_strtolower($value), mb_strtolower($this->string)) |
||
| 48 | : mb_strpos($value, $this->string); |
||
| 49 | |||
| 50 | if ($contains === false) { |
||
| 51 | $this->error = sprintf("String \"%s\" doesn't contains \"%s\".", $value, $this->string); |
||
| 52 | return false; |
||
| 53 | } |
||
| 54 | |||
| 55 | return true; |
||
| 56 | } |
||
| 57 | |||
| 66 |