@@ -6,27 +6,27 @@ |
||
6 | 6 | |
7 | 7 | class LteTest extends TestCase |
8 | 8 | { |
9 | - public function testLteWithFirstArgIsLessThanSecondOne() |
|
10 | - { |
|
9 | + public function testLteWithFirstArgIsLessThanSecondOne() |
|
10 | + { |
|
11 | 11 | $firstArg = 1; |
12 | 12 | $secondArg = 2; |
13 | 13 | $actual = lte($firstArg)($secondArg); |
14 | 14 | $this->assertTrue($actual); |
15 | - } |
|
15 | + } |
|
16 | 16 | |
17 | - public function testLteWithFirstArgIsEqualToSecondOne() |
|
18 | - { |
|
17 | + public function testLteWithFirstArgIsEqualToSecondOne() |
|
18 | + { |
|
19 | 19 | $firstArg = 2; |
20 | 20 | $secondArg = 2; |
21 | 21 | $actual = lte($firstArg)($secondArg); |
22 | 22 | $this->assertTrue($actual); |
23 | - } |
|
23 | + } |
|
24 | 24 | |
25 | - public function testLteWithFirstArgIsGreaterThanSecondOne() |
|
26 | - { |
|
25 | + public function testLteWithFirstArgIsGreaterThanSecondOne() |
|
26 | + { |
|
27 | 27 | $firstArg = 3; |
28 | 28 | $secondArg = 2; |
29 | 29 | $actual = lte($firstArg)($secondArg); |
30 | 30 | $this->assertFalse($actual); |
31 | - } |
|
31 | + } |
|
32 | 32 | } |
@@ -6,18 +6,18 @@ |
||
6 | 6 | |
7 | 7 | class TailTest extends TestCase |
8 | 8 | { |
9 | - public function testTail() |
|
10 | - { |
|
9 | + public function testTail() |
|
10 | + { |
|
11 | 11 | $argument = [1, 2, 3, 4, 5]; |
12 | 12 | $expect = 5; |
13 | 13 | $actual = tail()($argument); |
14 | 14 | $this->assertEquals($expect, $actual); |
15 | - } |
|
15 | + } |
|
16 | 16 | |
17 | - public function testTailWithEmptyArray() |
|
18 | - { |
|
17 | + public function testTailWithEmptyArray() |
|
18 | + { |
|
19 | 19 | $argument = []; |
20 | 20 | $actual = tail()($argument); |
21 | 21 | $this->assertNull($actual); |
22 | - } |
|
22 | + } |
|
23 | 23 | } |
@@ -6,18 +6,18 @@ |
||
6 | 6 | |
7 | 7 | class FirstTest extends TestCase |
8 | 8 | { |
9 | - public function testFirst() |
|
10 | - { |
|
9 | + public function testFirst() |
|
10 | + { |
|
11 | 11 | $argument = [1, 2, 3, 4, 5]; |
12 | 12 | $expect = 1; |
13 | 13 | $actual = first()($argument); |
14 | 14 | $this->assertEquals($expect, $actual); |
15 | - } |
|
15 | + } |
|
16 | 16 | |
17 | - public function testFirstWithEmptyArray() |
|
18 | - { |
|
17 | + public function testFirstWithEmptyArray() |
|
18 | + { |
|
19 | 19 | $argument = []; |
20 | 20 | $actual = first()($argument); |
21 | 21 | $this->assertNull($actual); |
22 | - } |
|
22 | + } |
|
23 | 23 | } |
@@ -6,19 +6,19 @@ |
||
6 | 6 | |
7 | 7 | class ContainsTest extends TestCase |
8 | 8 | { |
9 | - public function testArrayContainsItem() |
|
10 | - { |
|
9 | + public function testArrayContainsItem() |
|
10 | + { |
|
11 | 11 | $item = 1; |
12 | 12 | $array = [1, 2, 3, 4, 5]; |
13 | 13 | $actual = contains($item)($array); |
14 | 14 | $this->assertTrue($actual); |
15 | - } |
|
15 | + } |
|
16 | 16 | |
17 | - public function testArrayDoesNotContainItem() |
|
18 | - { |
|
17 | + public function testArrayDoesNotContainItem() |
|
18 | + { |
|
19 | 19 | $item = 1; |
20 | 20 | $array = [2, 3, 4, 5]; |
21 | 21 | $actual = contains($item)($array); |
22 | 22 | $this->assertFalse($actual); |
23 | - } |
|
23 | + } |
|
24 | 24 | } |
@@ -6,19 +6,19 @@ |
||
6 | 6 | |
7 | 7 | class DefaultToTest extends TestCase |
8 | 8 | { |
9 | - public function testDefaultToAndGetDefaultValue() |
|
10 | - { |
|
9 | + public function testDefaultToAndGetDefaultValue() |
|
10 | + { |
|
11 | 11 | $value = null; |
12 | 12 | $defaultValue = 10; |
13 | 13 | $actual = defaultTo($defaultValue)($value); |
14 | 14 | $this->assertEquals($defaultValue, $actual); |
15 | - } |
|
15 | + } |
|
16 | 16 | |
17 | - public function testDefaultToAndGetInputValue() |
|
18 | - { |
|
17 | + public function testDefaultToAndGetInputValue() |
|
18 | + { |
|
19 | 19 | $value = 50; |
20 | 20 | $defaultValue = 10; |
21 | 21 | $actual = defaultTo($defaultValue)($value); |
22 | 22 | $this->assertEquals($value, $actual); |
23 | - } |
|
23 | + } |
|
24 | 24 | } |
@@ -6,18 +6,18 @@ |
||
6 | 6 | |
7 | 7 | class LastTest extends TestCase |
8 | 8 | { |
9 | - public function testLast() |
|
10 | - { |
|
9 | + public function testLast() |
|
10 | + { |
|
11 | 11 | $argument = [1, 2, 3, 4, 5]; |
12 | 12 | $expect = 5; |
13 | 13 | $actual = last()($argument); |
14 | 14 | $this->assertEquals($expect, $actual); |
15 | - } |
|
15 | + } |
|
16 | 16 | |
17 | - public function testLastWithEmptyArray() |
|
18 | - { |
|
17 | + public function testLastWithEmptyArray() |
|
18 | + { |
|
19 | 19 | $argument = []; |
20 | 20 | $actual = last()($argument); |
21 | 21 | $this->assertNull($actual); |
22 | - } |
|
22 | + } |
|
23 | 23 | } |
@@ -8,35 +8,35 @@ |
||
8 | 8 | class IdenticalTest extends TestCase |
9 | 9 | { |
10 | 10 | |
11 | - public function testIdenticalWithSameObject() |
|
12 | - { |
|
11 | + public function testIdenticalWithSameObject() |
|
12 | + { |
|
13 | 13 | $firstValue = new PlainObjectAsset(); |
14 | 14 | $secondValue = $firstValue; |
15 | 15 | $actual = identical($firstValue)($secondValue); |
16 | 16 | $this->assertTrue($actual); |
17 | - } |
|
17 | + } |
|
18 | 18 | |
19 | - public function testIdenticalWithDifferenceObject() |
|
20 | - { |
|
19 | + public function testIdenticalWithDifferenceObject() |
|
20 | + { |
|
21 | 21 | $firstValue = new PlainObjectAsset(); |
22 | 22 | $secondValue = new PlainObjectAsset(); |
23 | 23 | $actual = identical($firstValue)($secondValue); |
24 | 24 | $this->assertFalse($actual); |
25 | - } |
|
25 | + } |
|
26 | 26 | |
27 | - public function testIdenticalWithSamePrimitiveValue() |
|
28 | - { |
|
27 | + public function testIdenticalWithSamePrimitiveValue() |
|
28 | + { |
|
29 | 29 | $firstValue = '1'; |
30 | 30 | $secondValue = '1'; |
31 | 31 | $actual = identical($firstValue)($secondValue); |
32 | 32 | $this->assertTrue($actual); |
33 | - } |
|
33 | + } |
|
34 | 34 | |
35 | - public function testIdenticalWithDifferencePrimitiveValue() |
|
36 | - { |
|
35 | + public function testIdenticalWithDifferencePrimitiveValue() |
|
36 | + { |
|
37 | 37 | $firstValue = '11'; |
38 | 38 | $secondValue = '22'; |
39 | 39 | $actual = identical($firstValue)($secondValue); |
40 | 40 | $this->assertFalse($actual); |
41 | - } |
|
41 | + } |
|
42 | 42 | } |
@@ -7,10 +7,10 @@ |
||
7 | 7 | |
8 | 8 | class IdentityTest extends TestCase |
9 | 9 | { |
10 | - public function testIdentity() |
|
11 | - { |
|
10 | + public function testIdentity() |
|
11 | + { |
|
12 | 12 | $value = new PlainObjectAsset(); |
13 | 13 | $actual = identity()($value); |
14 | 14 | $this->assertSame($value, $actual); |
15 | - } |
|
15 | + } |
|
16 | 16 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | */ |
9 | 9 | function equals() |
10 | 10 | { |
11 | - $equals = function ($a, $b) { |
|
11 | + $equals = function($a, $b) { |
|
12 | 12 | return $a == $b; |
13 | 13 | }; |
14 | 14 | $arguments = func_get_args(); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | function gt() |
20 | 20 | { |
21 | - $gt = function ($a, $b) { |
|
21 | + $gt = function($a, $b) { |
|
22 | 22 | return $a > $b; |
23 | 23 | }; |
24 | 24 | $arguments = func_get_args(); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | function gte() |
30 | 30 | { |
31 | - $gte = function ($a, $b) { |
|
31 | + $gte = function($a, $b) { |
|
32 | 32 | return $a >= $b; |
33 | 33 | }; |
34 | 34 | $arguments = func_get_args(); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | function identical() |
46 | 46 | { |
47 | - $identical = function ($firstValue, $secondValue) { |
|
47 | + $identical = function($firstValue, $secondValue) { |
|
48 | 48 | return $firstValue === $secondValue; |
49 | 49 | }; |
50 | 50 | $arguments = func_get_args(); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | function lt() |
56 | 56 | { |
57 | - $lt = function ($a, $b) { |
|
57 | + $lt = function($a, $b) { |
|
58 | 58 | return $a < $b; |
59 | 59 | }; |
60 | 60 | $arguments = func_get_args(); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | function lte() |
66 | 66 | { |
67 | - $lte = function ($a, $b) { |
|
67 | + $lte = function($a, $b) { |
|
68 | 68 | return $a <= $b; |
69 | 69 | }; |
70 | 70 | $arguments = func_get_args(); |
@@ -8,32 +8,32 @@ discard block |
||
8 | 8 | */ |
9 | 9 | function equals() |
10 | 10 | { |
11 | - $equals = function ($a, $b) { |
|
11 | + $equals = function ($a, $b) { |
|
12 | 12 | return $a == $b; |
13 | - }; |
|
14 | - $arguments = func_get_args(); |
|
15 | - $curried = curryN($equals, 2); |
|
16 | - return call_user_func_array($curried, $arguments); |
|
13 | + }; |
|
14 | + $arguments = func_get_args(); |
|
15 | + $curried = curryN($equals, 2); |
|
16 | + return call_user_func_array($curried, $arguments); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | function gt() |
20 | 20 | { |
21 | - $gt = function ($a, $b) { |
|
21 | + $gt = function ($a, $b) { |
|
22 | 22 | return $a > $b; |
23 | - }; |
|
24 | - $arguments = func_get_args(); |
|
25 | - $curried = curryN($gt, 2); |
|
26 | - return call_user_func_array($curried, $arguments); |
|
23 | + }; |
|
24 | + $arguments = func_get_args(); |
|
25 | + $curried = curryN($gt, 2); |
|
26 | + return call_user_func_array($curried, $arguments); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | function gte() |
30 | 30 | { |
31 | - $gte = function ($a, $b) { |
|
31 | + $gte = function ($a, $b) { |
|
32 | 32 | return $a >= $b; |
33 | - }; |
|
34 | - $arguments = func_get_args(); |
|
35 | - $curried = curryN($gte, 2); |
|
36 | - return call_user_func_array($curried, $arguments); |
|
33 | + }; |
|
34 | + $arguments = func_get_args(); |
|
35 | + $curried = curryN($gte, 2); |
|
36 | + return call_user_func_array($curried, $arguments); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -44,32 +44,32 @@ discard block |
||
44 | 44 | */ |
45 | 45 | function identical() |
46 | 46 | { |
47 | - $identical = function ($firstValue, $secondValue) { |
|
47 | + $identical = function ($firstValue, $secondValue) { |
|
48 | 48 | return $firstValue === $secondValue; |
49 | - }; |
|
50 | - $arguments = func_get_args(); |
|
51 | - $curried = curryN($identical, 2); |
|
52 | - return call_user_func_array($curried, $arguments); |
|
49 | + }; |
|
50 | + $arguments = func_get_args(); |
|
51 | + $curried = curryN($identical, 2); |
|
52 | + return call_user_func_array($curried, $arguments); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | function lt() |
56 | 56 | { |
57 | - $lt = function ($a, $b) { |
|
57 | + $lt = function ($a, $b) { |
|
58 | 58 | return $a < $b; |
59 | - }; |
|
60 | - $arguments = func_get_args(); |
|
61 | - $curried = curryN($lt, 2); |
|
62 | - return call_user_func_array($curried, $arguments); |
|
59 | + }; |
|
60 | + $arguments = func_get_args(); |
|
61 | + $curried = curryN($lt, 2); |
|
62 | + return call_user_func_array($curried, $arguments); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | function lte() |
66 | 66 | { |
67 | - $lte = function ($a, $b) { |
|
67 | + $lte = function ($a, $b) { |
|
68 | 68 | return $a <= $b; |
69 | - }; |
|
70 | - $arguments = func_get_args(); |
|
71 | - $curried = curryN($lte, 2); |
|
72 | - return call_user_func_array($curried, $arguments); |
|
69 | + }; |
|
70 | + $arguments = func_get_args(); |
|
71 | + $curried = curryN($lte, 2); |
|
72 | + return call_user_func_array($curried, $arguments); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | */ |
80 | 80 | function max() |
81 | 81 | { |
82 | - $arguments = func_get_args(); |
|
83 | - $curried = curryN('max', 2); |
|
84 | - return call_user_func_array($curried, $arguments); |
|
82 | + $arguments = func_get_args(); |
|
83 | + $curried = curryN('max', 2); |
|
84 | + return call_user_func_array($curried, $arguments); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | function min() |
94 | 94 | { |
95 | - $arguments = func_get_args(); |
|
96 | - $curried = curryN('min', 2); |
|
97 | - return call_user_func_array($curried, $arguments); |
|
95 | + $arguments = func_get_args(); |
|
96 | + $curried = curryN('min', 2); |
|
97 | + return call_user_func_array($curried, $arguments); |
|
98 | 98 | } |