@@ -8,9 +8,9 @@ |
||
8 | 8 | { |
9 | 9 | public function testFilter() |
10 | 10 | { |
11 | - $isEven = function ($it) { |
|
11 | + $isEven = function($it) { |
|
12 | 12 | return $it % 2 == 0; |
13 | 13 | }; |
14 | - $this->assertEquals([2,4,6], filter($isEven)([1,2,3,4,5,6])); |
|
14 | + $this->assertEquals([2, 4, 6], filter($isEven)([1, 2, 3, 4, 5, 6])); |
|
15 | 15 | } |
16 | 16 | } |
@@ -8,9 +8,9 @@ |
||
8 | 8 | { |
9 | 9 | public function testReduce() |
10 | 10 | { |
11 | - $add = function ($a, $b) { |
|
11 | + $add = function($a, $b) { |
|
12 | 12 | return $a + $b; |
13 | 13 | }; |
14 | - $this->assertEquals(15, reduce($add)(0)([1,2,3,4,5])); |
|
14 | + $this->assertEquals(15, reduce($add)(0)([1, 2, 3, 4, 5])); |
|
15 | 15 | } |
16 | 16 | } |
@@ -9,7 +9,7 @@ |
||
9 | 9 | public function testMap() |
10 | 10 | { |
11 | 11 | $array = [1, 2, 3, 4]; |
12 | - $add10 = function ($it) { |
|
12 | + $add10 = function($it) { |
|
13 | 13 | return $it + 10; |
14 | 14 | }; |
15 | 15 | $this->assertEquals([11, 12, 13, 14], map($add10)($array)); |
@@ -8,9 +8,9 @@ |
||
8 | 8 | { |
9 | 9 | public function testFilter() |
10 | 10 | { |
11 | - $isEven = function ($it) { |
|
11 | + $isEven = function($it) { |
|
12 | 12 | return $it % 2 == 0; |
13 | 13 | }; |
14 | - $this->assertEquals([1 => 2, 3 => 4, 5 => 6], filterPreserveKey($isEven)([1,2,3,4,5,6])); |
|
14 | + $this->assertEquals([1 => 2, 3 => 4, 5 => 6], filterPreserveKey($isEven)([1, 2, 3, 4, 5, 6])); |
|
15 | 15 | } |
16 | 16 | } |
@@ -25,10 +25,10 @@ |
||
25 | 25 | public function testComposeMultipleMethods() |
26 | 26 | { |
27 | 27 | $composed = compose( |
28 | - function ($i) { |
|
28 | + function($i) { |
|
29 | 29 | return $i * 10; |
30 | 30 | }, |
31 | - function ($a, $b) { |
|
31 | + function($a, $b) { |
|
32 | 32 | return $a + $b; |
33 | 33 | } |
34 | 34 | ); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | { |
9 | 9 | public function testAllAndExpectTrue() |
10 | 10 | { |
11 | - $lessThan10 = function ($it) { |
|
11 | + $lessThan10 = function($it) { |
|
12 | 12 | return $it < 10; |
13 | 13 | }; |
14 | 14 | $this->assertTrue(all($lessThan10)([1, 2, 3, 4])); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | public function testAllAndExpectFalse() |
18 | 18 | { |
19 | - $lessThan10 = function ($it) { |
|
19 | + $lessThan10 = function($it) { |
|
20 | 20 | return $it < 10; |
21 | 21 | }; |
22 | 22 | $this->assertFalse(all($lessThan10)([1, 2, 3, 4, 20])); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | public function testAllWithEmptyArray() |
26 | 26 | { |
27 | - $predicate = function ($it) { |
|
27 | + $predicate = function($it) { |
|
28 | 28 | return true; |
29 | 29 | }; |
30 | 30 | $this->assertFalse(all($predicate)([])); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | public function testAnyAndExpectTrue() |
11 | 11 | { |
12 | - $lessThan2 = function ($it) { |
|
12 | + $lessThan2 = function($it) { |
|
13 | 13 | return $it < 2; |
14 | 14 | }; |
15 | 15 | $this->assertTrue(any($lessThan2)([1, 2, 3, 4])); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | public function testAnyAndExpectFalse() |
19 | 19 | { |
20 | - $lessThan2 = function ($it) { |
|
20 | + $lessThan2 = function($it) { |
|
21 | 21 | return $it < 2; |
22 | 22 | }; |
23 | 23 | $this->assertFalse(any($lessThan2)([3, 4, 5, 6])); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | public function testAnyWithEmptyArray() |
27 | 27 | { |
28 | - $predicate = function ($it) { |
|
28 | + $predicate = function($it) { |
|
29 | 29 | return true; |
30 | 30 | }; |
31 | 31 | $this->assertFalse(any($predicate)([])); |
@@ -10,6 +10,6 @@ |
||
10 | 10 | // TODO |
11 | 11 | public function testDropFirst() |
12 | 12 | { |
13 | - $this->assertEquals([2,3,4], dropFirst()([1,2,3,4])); |
|
13 | + $this->assertEquals([2, 3, 4], dropFirst()([1, 2, 3, 4])); |
|
14 | 14 | } |
15 | 15 | } |
@@ -10,20 +10,20 @@ |
||
10 | 10 | public function testCurryNWithInvokeFunctionDirectly() |
11 | 11 | { |
12 | 12 | $curriedReduce = curryN('array_reduce', 3); |
13 | - $add = function ($a, $b) { |
|
13 | + $add = function($a, $b) { |
|
14 | 14 | return $a + $b; |
15 | 15 | }; |
16 | - $result = $curriedReduce([4,5,6], $add, 0); |
|
16 | + $result = $curriedReduce([4, 5, 6], $add, 0); |
|
17 | 17 | $this->assertEquals(15, $result); |
18 | 18 | } |
19 | 19 | |
20 | 20 | public function testCurryNWithAutoCurry() |
21 | 21 | { |
22 | 22 | $curriedReduce = curryN('array_reduce', 3); |
23 | - $add = function ($a, $b) { |
|
23 | + $add = function($a, $b) { |
|
24 | 24 | return $a + $b; |
25 | 25 | }; |
26 | - $result = $curriedReduce([4,5,6])($add)(0); |
|
26 | + $result = $curriedReduce([4, 5, 6])($add)(0); |
|
27 | 27 | $this->assertEquals(15, $result); |
28 | 28 | } |
29 | 29 | } |