@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('mapIndexed', function (callable $fn, array $list): array { |
|
6 | +P::macro('mapIndexed', function(callable $fn, array $list): array { |
|
7 | 7 | $keys = array_keys($list); |
8 | 8 | $mapped = array_map($fn, $list, $keys); |
9 | 9 |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('find', function (callable $predicate, array $list) { |
|
6 | +P::macro('find', function(callable $predicate, array $list) { |
|
7 | 7 | foreach ($list as $item) { |
8 | 8 | if (true === $predicate($item)) { |
9 | 9 | return $item; |
@@ -3,6 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('reject', function (callable $predicate, array $list): array { |
|
6 | +P::macro('reject', function(callable $predicate, array $list): array { |
|
7 | 7 | return P::filter(P::negate($predicate), $list); |
8 | 8 | }); |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('slice', function (int $offset, int $length, $collection) { |
|
6 | +P::macro('slice', function(int $offset, int $length, $collection) { |
|
7 | 7 | return P::apply( |
8 | 8 | P::typeCond([ |
9 | 9 | ['array', P::partialRight('\\array_slice', [$offset, $length])], |
@@ -3,6 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('none', function (callable $predicate, array $list): bool { |
|
6 | +P::macro('none', function(callable $predicate, array $list): bool { |
|
7 | 7 | return P::all(P::negate($predicate), $list); |
8 | 8 | }); |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('any', function (callable $predicate, array $list): bool { |
|
6 | +P::macro('any', function(callable $predicate, array $list): bool { |
|
7 | 7 | foreach ($list as $value) { |
8 | 8 | if (true === $predicate($value)) { |
9 | 9 | return true; |
@@ -3,8 +3,8 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('partialRight', function (callable $fn, array $args): \Closure { |
|
7 | - return function (...$innerArgs) use ($fn, $args) { |
|
6 | +P::macro('partialRight', function(callable $fn, array $args): \Closure { |
|
7 | + return function(...$innerArgs) use ($fn, $args) { |
|
8 | 8 | return $fn(...array_merge($innerArgs, $args)); |
9 | 9 | }; |
10 | 10 | }); |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('tap', function (callable $fn, $value) { |
|
6 | +P::macro('tap', function(callable $fn, $value) { |
|
7 | 7 | $fn($value); |
8 | 8 | return $value; |
9 | 9 | }); |
@@ -3,8 +3,8 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('throwException', function (string $exception, array $args): \Closure { |
|
7 | - return function () use ($exception, $args) { |
|
6 | +P::macro('throwException', function(string $exception, array $args): \Closure { |
|
7 | + return function() use ($exception, $args) { |
|
8 | 8 | throw new $exception(...$args); |
9 | 9 | }; |
10 | 10 | }); |