Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
9 | public function test() |
||
10 | { |
||
11 | $isEven = function ($n) { return $n % 2 === 0; }; |
||
12 | $isOdd = function ($n) { return $n % 2 === 1; }; |
||
13 | |||
14 | $this->assertTrue(any($isEven)([1, 3, 4, 5, 7])); |
||
15 | $this->assertFalse(any($isEven)([1, 3, 5, 7])); |
||
16 | |||
17 | $this->assertTrue(any($isOdd)([1, 3, 5, 7])); |
||
18 | $this->assertFalse(any($isOdd)([2, 4, 6])); |
||
19 | |||
20 | $this->assertTrue(any('is_array')([2, []])); |
||
21 | $this->assertFalse(any('is_array')(['s', 'x'])); |
||
22 | } |
||
23 | } |
||
24 |