Completed
Pull Request — master (#38)
by Radosław
01:58
created
src/macros/fn/of.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,6 +3,6 @@
 block discarded – undo
3 3
 
4 4
 use Baethon\Phln\Phln as P;
5 5
 
6
-P::macro('of', function ($value): array {
6
+P::macro('of', function($value): array {
7 7
     return [$value];
8 8
 });
Please login to merge, or discard this patch.
src/macros/fn/negate.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 
4 4
 use Baethon\Phln\Phln as P;
5 5
 
6
-P::macro('negate', function (callable $predicate): \Closure {
7
-    return function (...$args) use ($predicate) {
6
+P::macro('negate', function(callable $predicate): \Closure {
7
+    return function(...$args) use ($predicate) {
8 8
         return !$predicate(...$args);
9 9
     };
10 10
 });
Please login to merge, or discard this patch.
src/macros/fn/always.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 
4 4
 use Baethon\Phln\Phln as P;
5 5
 
6
-P::macro('always', function ($value): \Closure {
7
-    return function () use ($value) {
6
+P::macro('always', function($value): \Closure {
7
+    return function() use ($value) {
8 8
         return $value;
9 9
     };
10 10
 });
Please login to merge, or discard this patch.
src/macros/fn/once.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@
 block discarded – undo
3 3
 
4 4
 use Baethon\Phln\Phln as P;
5 5
 
6
-P::macro('once', function (callable $fn): \Closure {
7
-    return function (... $args) use ($fn) {
6
+P::macro('once', function(callable $fn): \Closure {
7
+    return function(... $args) use ($fn) {
8 8
         static $result;
9 9
 
10 10
         if (false === is_object($result)) {
11
-            $result = (object)['result' => $fn(... $args)];
11
+            $result = (object) ['result' => $fn(... $args)];
12 12
         }
13 13
 
14 14
         return $result->result;
Please login to merge, or discard this patch.
src/macros/fn/identity.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,6 +3,6 @@
 block discarded – undo
3 3
 
4 4
 use Baethon\Phln\Phln as P;
5 5
 
6
-P::macro('identity', function ($value) {
6
+P::macro('identity', function($value) {
7 7
     return $value;
8 8
 });
Please login to merge, or discard this patch.
src/macros/fn/F.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 
4 4
 use Baethon\Phln\Phln as P;
5 5
 
6
-P::macro('F', function (): bool {
6
+P::macro('F', function(): bool {
7 7
     return false;
8 8
 });
9 9
 
Please login to merge, or discard this patch.
src/macros/fn/compose.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 
4 4
 use Baethon\Phln\Phln as P;
5 5
 
6
-P::macro('compose', function (array $fns): \Closure {
6
+P::macro('compose', function(array $fns): \Closure {
7 7
     if (0 === count($fns)) {
8 8
         throw new \UnderflowException('compose requires at least one argument');
9 9
     }
Please login to merge, or discard this patch.
src/macros/fn/T.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 
4 4
 use Baethon\Phln\Phln as P;
5 5
 
6
-P::macro('T', function (): bool {
6
+P::macro('T', function(): bool {
7 7
     return true;
8 8
 });
9 9
 
Please login to merge, or discard this patch.
src/macros/fn/pipe.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,16 +3,16 @@
 block discarded – undo
3 3
 
4 4
 use Baethon\Phln\Phln as P;
5 5
 
6
-P::macro('pipe', function (array $fns): \Closure {
6
+P::macro('pipe', function(array $fns): \Closure {
7 7
     if (0 === count($fns)) {
8 8
         throw new \UnderflowException('pipe requires at least one argument');
9 9
     }
10 10
 
11
-    return function (...$args) use ($fns) {
11
+    return function(...$args) use ($fns) {
12 12
         $head = $fns[0];
13 13
         $tail = array_slice($fns, 1);
14 14
 
15
-        return array_reduce($tail, function ($carry, callable $fn) {
15
+        return array_reduce($tail, function($carry, callable $fn) {
16 16
             return $fn($carry);
17 17
         }, $head(... $args));
18 18
     };
Please login to merge, or discard this patch.