Conditions | 6 |
Paths | 6 |
Total Lines | 26 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
24 | protected function doMatch($actual) |
||
25 | { |
||
26 | if ($actual instanceof Traversable) { |
||
27 | $isMatch = false; |
||
28 | |||
29 | foreach ($actual as $value) { |
||
30 | if ($value === $this->expected) { |
||
31 | $isMatch = true; |
||
32 | |||
33 | break; |
||
34 | } |
||
35 | } |
||
36 | |||
37 | return $isMatch; |
||
38 | } |
||
39 | |||
40 | if (is_array($actual)) { |
||
41 | return array_search($this->expected, $actual, true) !== false; |
||
42 | } |
||
43 | |||
44 | if (is_string($actual)) { |
||
45 | return strpos($actual, $this->expected) !== false; |
||
46 | } |
||
47 | |||
48 | throw new InvalidArgumentException("Inclusion matcher requires a string or array"); |
||
49 | } |
||
50 | |||
64 |