| 1 | <?php |
||
| 6 | class ToEqualOneOf |
||
| 7 | { |
||
| 8 | /** |
||
| 9 | * Checks that `$expected` has value of `$actual` ( loose ). |
||
| 10 | * |
||
| 11 | * @param mixed $actual The actual value |
||
| 12 | * @param mixed $expected The expected value |
||
| 13 | * |
||
| 14 | * @return bool |
||
| 15 | */ |
||
| 16 | public static function match($actual, $expected) |
||
| 17 | { |
||
| 18 | if (is_array($expected) || $expected instanceof Traversable) { |
||
| 19 | foreach ($expected as $key => $value) { |
||
| 20 | if ($value == $actual) { |
||
| 21 | 2 | return true; |
|
| 22 | } |
||
| 23 | } |
||
| 24 | } |
||
| 25 | |||
| 26 | 1 | return false; |
|
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Returns the description message. |
||
| 31 | * |
||
| 32 | * @return string The description message |
||
| 33 | */ |
||
| 34 | public static function description() |
||
| 38 | } |
||
| 39 |