@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('pipe', function (...$fns): \Closure { |
|
6 | +P::macro('pipe', function(...$fns): \Closure { |
|
7 | 7 | $fnsCount = count($fns); |
8 | 8 | |
9 | 9 | if (1 === $fnsCount && is_array($fns[0])) { |
@@ -13,11 +13,11 @@ discard block |
||
13 | 13 | |
14 | 14 | assert($fnsCount > 0, new \UnderflowException('pipe requires at least one argument')); |
15 | 15 | |
16 | - return function (...$args) use ($fns) { |
|
16 | + return function(...$args) use ($fns) { |
|
17 | 17 | $head = $fns[0]; |
18 | 18 | $tail = array_slice($fns, 1); |
19 | 19 | |
20 | - return array_reduce($tail, function ($carry, callable $fn) { |
|
20 | + return array_reduce($tail, function($carry, callable $fn) { |
|
21 | 21 | return $fn($carry); |
22 | 22 | }, $head(... $args)); |
23 | 23 | }; |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('hasMethod', function ($method, $object) { |
|
6 | +P::macro('hasMethod', function($method, $object) { |
|
7 | 7 | try { |
8 | 8 | $reflection = new \ReflectionObject($object); |
9 | 9 |
@@ -92,7 +92,7 @@ |
||
92 | 92 | */ |
93 | 93 | public static function __callStatic($method, $parameters) |
94 | 94 | { |
95 | - if (! static::hasMacro($method)) { |
|
95 | + if (!static::hasMacro($method)) { |
|
96 | 96 | throw new \BadMethodCallException("Method {$method} does not exist."); |
97 | 97 | } |
98 | 98 |
@@ -22,7 +22,7 @@ |
||
22 | 22 | { |
23 | 23 | $fn = $this->fn; |
24 | 24 | |
25 | - return function () use ($args, $fn) { |
|
25 | + return function() use ($args, $fn) { |
|
26 | 26 | return $fn(...$args); |
27 | 27 | }; |
28 | 28 | } |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | use Baethon\Phln\Phln as P; |
6 | 6 | |
7 | -P::macro('cond', function (array $pairs): \Closure { |
|
8 | - return function (...$args) use ($pairs) { |
|
7 | +P::macro('cond', function(array $pairs): \Closure { |
|
8 | + return function(...$args) use ($pairs) { |
|
9 | 9 | $callPredicate = P::partialRight(P::apply(), [$args]); |
10 | 10 | $pairMatchingArgs = P::compose($callPredicate, P::nth(0)); |
11 | 11 | $getTransformer = P::pipe( |
@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | use function Baethon\Phln\assert_object; |
8 | 8 | |
9 | -P::macro('propEq', function (string $prop, $value, $object): bool { |
|
9 | +P::macro('propEq', function(string $prop, $value, $object): bool { |
|
10 | 10 | assert_object($object); |
11 | 11 | |
12 | 12 | return P::apply( |
@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | use function Baethon\Phln\assert_object; |
8 | 8 | |
9 | -P::macro('omit', function (array $omitKeys, $object): array { |
|
9 | +P::macro('omit', function(array $omitKeys, $object): array { |
|
10 | 10 | assert_object($object); |
11 | 11 | |
12 | 12 | return array_diff_key((array) $object, array_combine($omitKeys, $omitKeys) ?: []); |
@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | use function Baethon\Phln\assert_object; |
8 | 8 | |
9 | -P::macro('toPairs', function ($object): array { |
|
9 | +P::macro('toPairs', function($object): array { |
|
10 | 10 | assert_object($object); |
11 | 11 | |
12 | 12 | $pairs = []; |
@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | use function Baethon\Phln\assert_object; |
8 | 8 | |
9 | -P::macro('has', function (string $prop, $object) { |
|
9 | +P::macro('has', function(string $prop, $object) { |
|
10 | 10 | assert_object($object); |
11 | 11 | |
12 | 12 | return is_object($object) |