Completed
Pull Request — master (#38)
by Radosław
02:32
created
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.
src/macros/object/omit.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 use Baethon\Phln\Phln as P;
5 5
 use function Baethon\Phln\assert_object;
6 6
 
7
-P::macro('omit', function (array $omitKeys, $object): array {
7
+P::macro('omit', function(array $omitKeys, $object): array {
8 8
     assert_object($object);
9 9
 
10 10
     return array_diff_key((array) $object, array_combine($omitKeys, $omitKeys));
Please login to merge, or discard this patch.
src/macros/object/where.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,13 +4,13 @@
 block discarded – undo
4 4
 use Baethon\Phln\Phln as P;
5 5
 use function Baethon\Phln\assert_object;
6 6
 
7
-P::macro('where', function (array $predicates, $object): bool {
7
+P::macro('where', function(array $predicates, $object): bool {
8 8
     assert_object($object);
9 9
 
10 10
     $keys = P::keys($predicates);
11 11
 
12 12
     return P::all(
13
-        function ($key) use ($keys, $object, $predicates) {
13
+        function($key) use ($keys, $object, $predicates) {
14 14
             $value = P::prop($key, $object);
15 15
             return $predicates[$key]($value);
16 16
         },
Please login to merge, or discard this patch.
src/macros/object/whereEq.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 use Baethon\Phln\Phln as P;
5 5
 use function Baethon\Phln\assert_object;
6 6
 
7
-P::macro('whereEq', function (array $predicates, $object): bool {
7
+P::macro('whereEq', function(array $predicates, $object): bool {
8 8
     assert_object($object);
9 9
 
10 10
     return P::where(
Please login to merge, or discard this patch.