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