Completed
Push — master ( e0849e...92baee )
by Siwapun
04:58
created
test/Asset/PlainObjectAsset.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -3,21 +3,21 @@
 block discarded – undo
3 3
 
4 4
 class PlainObjectAsset
5 5
 {
6
-  private $data;
6
+    private $data;
7 7
 
8
-  /**
9
-   * @return mixed
10
-   */
11
-  public function getData()
12
-  {
8
+    /**
9
+     * @return mixed
10
+     */
11
+    public function getData()
12
+    {
13 13
     return $this->data;
14
-  }
14
+    }
15 15
 
16
-  /**
17
-   * @param mixed $data
18
-   */
19
-  public function setData($data): void
20
-  {
16
+    /**
17
+     * @param mixed $data
18
+     */
19
+    public function setData($data): void
20
+    {
21 21
     $this->data = $data;
22
-  }
22
+    }
23 23
 }
Please login to merge, or discard this patch.
test/AllTest.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -6,27 +6,27 @@
 block discarded – undo
6 6
 
7 7
 class AllTest extends TestCase
8 8
 {
9
-  public function testAllAndExpectTrue()
10
-  {
9
+    public function testAllAndExpectTrue()
10
+    {
11 11
     $lessThan10 = function ($it) {
12
-      return $it < 10;
12
+        return $it < 10;
13 13
     };
14 14
     $this->assertTrue(all($lessThan10)([1, 2, 3, 4]));
15
-  }
15
+    }
16 16
 
17
-  public function testAllAndExpectFalse()
18
-  {
17
+    public function testAllAndExpectFalse()
18
+    {
19 19
     $lessThan10 = function ($it) {
20
-      return $it < 10;
20
+        return $it < 10;
21 21
     };
22 22
     $this->assertFalse(all($lessThan10)([1, 2, 3, 4, 20]));
23
-  }
23
+    }
24 24
 
25
-  public function testAllWithEmptyArray()
26
-  {
25
+    public function testAllWithEmptyArray()
26
+    {
27 27
     $predicate = function ($it) {
28
-      return true;
28
+        return true;
29 29
     };
30 30
     $this->assertFalse(all($predicate)([]));
31
-  }
31
+    }
32 32
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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)([]));
Please login to merge, or discard this patch.
test/AnyTest.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -7,27 +7,27 @@
 block discarded – undo
7 7
 class AnyTest extends TestCase
8 8
 {
9 9
 
10
-  public function testAnyAndExpectTrue()
11
-  {
10
+    public function testAnyAndExpectTrue()
11
+    {
12 12
     $lessThan2 = function ($it) {
13
-      return $it < 2;
13
+        return $it < 2;
14 14
     };
15 15
     $this->assertTrue(any($lessThan2)([1, 2, 3, 4]));
16
-  }
16
+    }
17 17
 
18
-  public function testAnyAndExpectFalse()
19
-  {
18
+    public function testAnyAndExpectFalse()
19
+    {
20 20
     $lessThan2 = function ($it) {
21
-      return $it < 2;
21
+        return $it < 2;
22 22
     };
23 23
     $this->assertFalse(any($lessThan2)([3, 4, 5, 6]));
24
-  }
24
+    }
25 25
 
26
-  public function testAnyWithEmptyArray()
27
-  {
26
+    public function testAnyWithEmptyArray()
27
+    {
28 28
     $predicate = function ($it) {
29
-      return true;
29
+        return true;
30 30
     };
31 31
     $this->assertFalse(any($predicate)([]));
32
-  }
32
+    }
33 33
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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)([]));
Please login to merge, or discard this patch.
test/DropFirstTest.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@
 block discarded – undo
7 7
 
8 8
 class DropFirstTest extends TestCase
9 9
 {
10
-  // TODO
11
-  public function testDropFirst()
12
-  {
10
+    // TODO
11
+    public function testDropFirst()
12
+    {
13 13
     $this->assertEquals([2,3,4], dropFirst()([1,2,3,4]));
14
-  }
14
+    }
15 15
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,6 +10,6 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
test/CurryNTest.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,23 +7,23 @@
 block discarded – undo
7 7
 class CurryNTest extends TestCase
8 8
 {
9 9
 
10
-  public function testCurryNWithInvokeFunctionDirectly()
11
-  {
10
+    public function testCurryNWithInvokeFunctionDirectly()
11
+    {
12 12
     $curriedReduce = curryN('array_reduce', 3);
13 13
     $add = function ($a, $b) {
14
-      return $a + $b;
14
+        return $a + $b;
15 15
     };
16 16
     $result = $curriedReduce([4,5,6], $add, 0);
17 17
     $this->assertEquals(15, $result);
18
-  }
18
+    }
19 19
 
20
-  public function testCurryNWithAutoCurry()
21
-  {
20
+    public function testCurryNWithAutoCurry()
21
+    {
22 22
     $curriedReduce = curryN('array_reduce', 3);
23 23
     $add = function ($a, $b) {
24
-      return $a + $b;
24
+        return $a + $b;
25 25
     };
26 26
     $result = $curriedReduce([4,5,6])($add)(0);
27 27
     $this->assertEquals(15, $result);
28
-  }
28
+    }
29 29
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,20 +10,20 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
test/PipeTest.php 2 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -8,30 +8,30 @@
 block discarded – undo
8 8
 class PipeTest extends TestCase
9 9
 {
10 10
 
11
-  /**
12
-   * @throws \Exception
13
-   */
14
-  public function testPipeSingleMethod()
15
-  {
11
+    /**
12
+     * @throws \Exception
13
+     */
14
+    public function testPipeSingleMethod()
15
+    {
16 16
     $piped = pipe(
17
-      always(10)
17
+        always(10)
18 18
     );
19 19
     $this->assertEquals(10, $piped());
20
-  }
20
+    }
21 21
 
22
-  /**
23
-   * @throws \Exception
24
-   */
25
-  public function testPipeMultipleMethods()
26
-  {
22
+    /**
23
+     * @throws \Exception
24
+     */
25
+    public function testPipeMultipleMethods()
26
+    {
27 27
     $piped = pipe(
28
-      function ($a, $b) {
28
+        function ($a, $b) {
29 29
         return $a + $b;
30
-      },
31
-      function ($i) {
30
+        },
31
+        function ($i) {
32 32
         return $i * 10;
33
-      }
33
+        }
34 34
     );
35 35
     $this->assertEquals(30, $piped(1, 2));
36
-  }
36
+    }
37 37
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,10 +25,10 @@
 block discarded – undo
25 25
   public function testPipeMultipleMethods()
26 26
   {
27 27
     $piped = pipe(
28
-      function ($a, $b) {
28
+      function($a, $b) {
29 29
         return $a + $b;
30 30
       },
31
-      function ($i) {
31
+      function($i) {
32 32
         return $i * 10;
33 33
       }
34 34
     );
Please login to merge, or discard this patch.
test/FactoryTest.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -8,18 +8,18 @@
 block discarded – undo
8 8
 class FactoryTest extends TestCase
9 9
 {
10 10
 
11
-  public function testFactoryMustReturnCorrectObjectType()
12
-  {
11
+    public function testFactoryMustReturnCorrectObjectType()
12
+    {
13 13
     $factory = factory(PlainObjectAsset::class);
14 14
     $obj = $factory();
15 15
     $this->assertInstanceOf(PlainObjectAsset::class, $obj);
16
-  }
16
+    }
17 17
 
18
-  public function testFactoryMustAlwaysReturnNewObject()
19
-  {
18
+    public function testFactoryMustAlwaysReturnNewObject()
19
+    {
20 20
     $factory = factory(PlainObjectAsset::class);
21 21
     $obj1 = $factory();
22 22
     $obj2 = $factory();
23 23
     $this->assertNotSame($obj1, $obj2);
24
-  }
24
+    }
25 25
 }
Please login to merge, or discard this patch.
src/list.php 2 patches
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -8,20 +8,20 @@  discard block
 block discarded – undo
8 8
  */
9 9
 function all()
10 10
 {
11
-  $all = function (callable $predicateFunction, array $array): bool {
11
+    $all = function (callable $predicateFunction, array $array): bool {
12 12
     if (empty($array)) {
13
-      return false;
13
+        return false;
14 14
     }
15 15
     foreach ($array as $it) {
16
-      if (!$predicateFunction($it)) {
16
+        if (!$predicateFunction($it)) {
17 17
         return false;
18
-      }
18
+        }
19 19
     }
20 20
     return true;
21
-  };
22
-  $arguments = func_get_args();
23
-  $curried = curryN($all, 2);
24
-  return call_user_func_array($curried, $arguments);
21
+    };
22
+    $arguments = func_get_args();
23
+    $curried = curryN($all, 2);
24
+    return call_user_func_array($curried, $arguments);
25 25
 }
26 26
 
27 27
 /**
@@ -31,20 +31,20 @@  discard block
 block discarded – undo
31 31
  */
32 32
 function any()
33 33
 {
34
-  $any = function (callable $predicateFunction, array $array) {
34
+    $any = function (callable $predicateFunction, array $array) {
35 35
     if (empty($array)) {
36
-      return false;
36
+        return false;
37 37
     }
38 38
     foreach ($array as $it) {
39
-      if ($predicateFunction($it)) {
39
+        if ($predicateFunction($it)) {
40 40
         return true;
41
-      }
41
+        }
42 42
     }
43 43
     return false;
44
-  };
45
-  $arguments = func_get_args();
46
-  $curriedAny = curryN($any, 2);
47
-  return call_user_func_array($curriedAny, $arguments);
44
+    };
45
+    $arguments = func_get_args();
46
+    $curriedAny = curryN($any, 2);
47
+    return call_user_func_array($curriedAny, $arguments);
48 48
 }
49 49
 
50 50
 /**
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
  */
55 55
 function drop()
56 56
 {
57
-  $drop = function (int $index, array $array) {
57
+    $drop = function (int $index, array $array) {
58 58
     return array_merge(array_slice($array, 0, $index), array_slice($array, $index + 1));
59
-  };
60
-  $arguments = func_get_args();
61
-  $curried = curryN($drop, 2);
62
-  return call_user_func_array($curried, $arguments);
59
+    };
60
+    $arguments = func_get_args();
61
+    $curried = curryN($drop, 2);
62
+    return call_user_func_array($curried, $arguments);
63 63
 }
64 64
 
65 65
 /**
@@ -68,10 +68,10 @@  discard block
 block discarded – undo
68 68
  */
69 69
 function dropFirst()
70 70
 {
71
-  $dropFirst = drop(0);
72
-  $arguments = func_get_args();
73
-  $curried = curryN($dropFirst, 1);
74
-  return call_user_func_array($curried, $arguments);
71
+    $dropFirst = drop(0);
72
+    $arguments = func_get_args();
73
+    $curried = curryN($dropFirst, 1);
74
+    return call_user_func_array($curried, $arguments);
75 75
 }
76 76
 
77 77
 /**
@@ -80,14 +80,14 @@  discard block
 block discarded – undo
80 80
  */
81 81
 function dropLast()
82 82
 {
83
-  $dropLast = function (array $array) {
83
+    $dropLast = function (array $array) {
84 84
     $index = count($array)-1;
85 85
     return array_merge(array_slice($array, 0, $index), array_slice($array, $index + 1));
86
-  };
86
+    };
87 87
 
88
-  $arguments = func_get_args();
89
-  $curried = curryN($dropLast, 1);
90
-  return call_user_func_array($curried, $arguments);
88
+    $arguments = func_get_args();
89
+    $curried = curryN($dropLast, 1);
90
+    return call_user_func_array($curried, $arguments);
91 91
 }
92 92
 
93 93
 /**
@@ -97,12 +97,12 @@  discard block
 block discarded – undo
97 97
  */
98 98
 function filter()
99 99
 {
100
-  $filter = function (callable $predicateFunction, array $array) {
100
+    $filter = function (callable $predicateFunction, array $array) {
101 101
     return array_values(array_filter($array, $predicateFunction));
102
-  };
103
-  $arguments = func_get_args();
104
-  $curried = curryN($filter, 2);
105
-  return call_user_func_array($curried, $arguments);
102
+    };
103
+    $arguments = func_get_args();
104
+    $curried = curryN($filter, 2);
105
+    return call_user_func_array($curried, $arguments);
106 106
 }
107 107
 
108 108
 /**
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
  */
113 113
 function filterPreserveKey()
114 114
 {
115
-  $filter = function (callable $predicateFunction, array $array) {
115
+    $filter = function (callable $predicateFunction, array $array) {
116 116
     return array_filter($array, $predicateFunction);
117
-  };
118
-  $arguments = func_get_args();
119
-  $curried = curryN($filter, 2);
120
-  return call_user_func_array($curried, $arguments);
117
+    };
118
+    $arguments = func_get_args();
119
+    $curried = curryN($filter, 2);
120
+    return call_user_func_array($curried, $arguments);
121 121
 }
122 122
 
123 123
 /**
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
  */
128 128
 function map()
129 129
 {
130
-  $arguments = func_get_args();
131
-  $curried = curryN('array_map', 2);
132
-  return call_user_func_array($curried, $arguments);
130
+    $arguments = func_get_args();
131
+    $curried = curryN('array_map', 2);
132
+    return call_user_func_array($curried, $arguments);
133 133
 }
134 134
 
135 135
 /**
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
  */
141 141
 function reduce()
142 142
 {
143
-  $reduce = function (callable $accumulator, $initialValue, array $array) {
143
+    $reduce = function (callable $accumulator, $initialValue, array $array) {
144 144
     return array_reduce($array, $accumulator, $initialValue);
145
-  };
146
-  $arguments = func_get_args();
147
-  $curried = curryN($reduce, 3);
148
-  return call_user_func_array($curried, $arguments);
145
+    };
146
+    $arguments = func_get_args();
147
+    $curried = curryN($reduce, 3);
148
+    return call_user_func_array($curried, $arguments);
149 149
 }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 function all()
10 10
 {
11
-  $all = function (callable $predicateFunction, array $array): bool {
11
+  $all = function(callable $predicateFunction, array $array): bool {
12 12
     if (empty($array)) {
13 13
       return false;
14 14
     }
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
  */
32 32
 function any()
33 33
 {
34
-  $any = function (callable $predicateFunction, array $array) {
34
+  $any = function(callable $predicateFunction, array $array) {
35 35
     if (empty($array)) {
36 36
       return false;
37 37
     }
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
  */
55 55
 function drop()
56 56
 {
57
-  $drop = function (int $index, array $array) {
57
+  $drop = function(int $index, array $array) {
58 58
     return array_merge(array_slice($array, 0, $index), array_slice($array, $index + 1));
59 59
   };
60 60
   $arguments = func_get_args();
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
  */
81 81
 function dropLast()
82 82
 {
83
-  $dropLast = function (array $array) {
84
-    $index = count($array)-1;
83
+  $dropLast = function(array $array) {
84
+    $index = count($array) - 1;
85 85
     return array_merge(array_slice($array, 0, $index), array_slice($array, $index + 1));
86 86
   };
87 87
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
  */
98 98
 function filter()
99 99
 {
100
-  $filter = function (callable $predicateFunction, array $array) {
100
+  $filter = function(callable $predicateFunction, array $array) {
101 101
     return array_values(array_filter($array, $predicateFunction));
102 102
   };
103 103
   $arguments = func_get_args();
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
  */
113 113
 function filterPreserveKey()
114 114
 {
115
-  $filter = function (callable $predicateFunction, array $array) {
115
+  $filter = function(callable $predicateFunction, array $array) {
116 116
     return array_filter($array, $predicateFunction);
117 117
   };
118 118
   $arguments = func_get_args();
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
  */
141 141
 function reduce()
142 142
 {
143
-  $reduce = function (callable $accumulator, $initialValue, array $array) {
143
+  $reduce = function(callable $accumulator, $initialValue, array $array) {
144 144
     return array_reduce($array, $accumulator, $initialValue);
145 145
   };
146 146
   $arguments = func_get_args();
Please login to merge, or discard this patch.
src/function.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -8,12 +8,12 @@  discard block
 block discarded – undo
8 8
  */
9 9
 function add()
10 10
 {
11
-  $add = function (int $a, int $b) {
11
+    $add = function (int $a, int $b) {
12 12
     return $a + $b;
13
-  };
14
-  $arguments = func_get_args();
15
-  $curried = curryN($add, 2);
16
-  return call_user_func_array($curried, $arguments);
13
+    };
14
+    $arguments = func_get_args();
15
+    $curried = curryN($add, 2);
16
+    return call_user_func_array($curried, $arguments);
17 17
 }
18 18
 
19 19
 /**
@@ -22,14 +22,14 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function always()
24 24
 {
25
-  $always = function ($data) {
25
+    $always = function ($data) {
26 26
     return function () use ($data) {
27
-      return $data;
27
+        return $data;
28
+    };
28 29
     };
29
-  };
30
-  $arguments = func_get_args();
31
-  $curried = curryN($always, 1);
32
-  return call_user_func_array($curried, $arguments);
30
+    $arguments = func_get_args();
31
+    $curried = curryN($always, 1);
32
+    return call_user_func_array($curried, $arguments);
33 33
 }
34 34
 
35 35
 /**
@@ -38,39 +38,39 @@  discard block
 block discarded – undo
38 38
  */
39 39
 function compose()
40 40
 {
41
-  $arguments = array_reverse(func_get_args());
42
-  return call_user_func_array('Aerophant\Ramda\pipe', $arguments);
41
+    $arguments = array_reverse(func_get_args());
42
+    return call_user_func_array('Aerophant\Ramda\pipe', $arguments);
43 43
 }
44 44
 
45 45
 function curryN(callable $fn, int $numberOfArguments)
46 46
 {
47
-  return function () use ($fn, $numberOfArguments) {
47
+    return function () use ($fn, $numberOfArguments) {
48 48
     $arguments = func_get_args();
49 49
     $length = count($arguments);
50 50
     if ($length > $numberOfArguments) {
51
-      throw new \InvalidArgumentException(
51
+        throw new \InvalidArgumentException(
52 52
         "Number of passed($length) parameters is greater than expected($numberOfArguments)"
53
-      );
53
+        );
54 54
     }
55 55
     // NO CURRY
56 56
     if ($length == $numberOfArguments) {
57
-      return call_user_func_array($fn, $arguments);
57
+        return call_user_func_array($fn, $arguments);
58 58
     }
59 59
     // AUTO CURRY
60 60
     $curriedFn = function () use ($fn, $arguments) {
61
-      $curriedArguments = func_get_args();
62
-      return call_user_func_array($fn, array_merge($arguments, $curriedArguments));
61
+        $curriedArguments = func_get_args();
62
+        return call_user_func_array($fn, array_merge($arguments, $curriedArguments));
63 63
     };
64 64
     return curryN($curriedFn, $numberOfArguments - $length);
65
-  };
65
+    };
66 66
 }
67 67
 
68 68
 //TODO change to construct
69 69
 function factory($class)
70 70
 {
71
-  return function () use ($class) {
71
+    return function () use ($class) {
72 72
     return new $class();
73
-  };
73
+    };
74 74
 }
75 75
 
76 76
 /**
@@ -79,17 +79,17 @@  discard block
 block discarded – undo
79 79
  */
80 80
 function pipe()
81 81
 {
82
-  $arguments = func_get_args();
83
-  $length = count($arguments);
84
-  if ($length === 0) {
82
+    $arguments = func_get_args();
83
+    $length = count($arguments);
84
+    if ($length === 0) {
85 85
     throw new \Exception("pipe requires at least one argument");
86
-  }
87
-  return function () use ($arguments) {
86
+    }
87
+    return function () use ($arguments) {
88 88
     $internalArguments = func_get_args();
89 89
     $initialValue = call_user_func_array($arguments[0], $internalArguments);
90 90
     $accumulator = function ($acc, $it) {
91
-      return call_user_func_array($it, [$acc]);
91
+        return call_user_func_array($it, [$acc]);
92 92
     };
93 93
     return array_reduce(drop(0, $arguments), $accumulator, $initialValue);
94
-  };
94
+    };
95 95
 }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 function add()
10 10
 {
11
-  $add = function (int $a, int $b) {
11
+  $add = function(int $a, int $b) {
12 12
     return $a + $b;
13 13
   };
14 14
   $arguments = func_get_args();
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function always()
24 24
 {
25
-  $always = function ($data) {
26
-    return function () use ($data) {
25
+  $always = function($data) {
26
+    return function() use ($data) {
27 27
       return $data;
28 28
     };
29 29
   };
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
 function curryN(callable $fn, int $numberOfArguments)
46 46
 {
47
-  return function () use ($fn, $numberOfArguments) {
47
+  return function() use ($fn, $numberOfArguments) {
48 48
     $arguments = func_get_args();
49 49
     $length = count($arguments);
50 50
     if ($length > $numberOfArguments) {
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
       return call_user_func_array($fn, $arguments);
58 58
     }
59 59
     // AUTO CURRY
60
-    $curriedFn = function () use ($fn, $arguments) {
60
+    $curriedFn = function() use ($fn, $arguments) {
61 61
       $curriedArguments = func_get_args();
62 62
       return call_user_func_array($fn, array_merge($arguments, $curriedArguments));
63 63
     };
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 //TODO change to construct
69 69
 function factory($class)
70 70
 {
71
-  return function () use ($class) {
71
+  return function() use ($class) {
72 72
     return new $class();
73 73
   };
74 74
 }
@@ -84,10 +84,10 @@  discard block
 block discarded – undo
84 84
   if ($length === 0) {
85 85
     throw new \Exception("pipe requires at least one argument");
86 86
   }
87
-  return function () use ($arguments) {
87
+  return function() use ($arguments) {
88 88
     $internalArguments = func_get_args();
89 89
     $initialValue = call_user_func_array($arguments[0], $internalArguments);
90
-    $accumulator = function ($acc, $it) {
90
+    $accumulator = function($acc, $it) {
91 91
       return call_user_func_array($it, [$acc]);
92 92
     };
93 93
     return array_reduce(drop(0, $arguments), $accumulator, $initialValue);
Please login to merge, or discard this patch.