@@ -3,8 +3,8 @@ |
||
| 3 | 3 | |
| 4 | 4 | use Baethon\Phln\Phln as P; |
| 5 | 5 | |
| 6 | -P::macro('invoker', function (int $arity, string $method): callable { |
|
| 7 | - $wrapper = function (...$args) use ($arity, $method) { |
|
| 6 | +P::macro('invoker', function(int $arity, string $method): callable { |
|
| 7 | + $wrapper = function(...$args) use ($arity, $method) { |
|
| 8 | 8 | $args = array_slice($args, 0, $arity + 1); |
| 9 | 9 | $object = array_pop($args); |
| 10 | 10 | |
@@ -6,6 +6,6 @@ |
||
| 6 | 6 | |
| 7 | 7 | load_macro('fn', 'always'); |
| 8 | 8 | |
| 9 | -P::macro('F', function (): callable { |
|
| 9 | +P::macro('F', function(): callable { |
|
| 10 | 10 | return P::always(false); |
| 11 | 11 | }); |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | |
| 7 | 7 | load_macro('fn', 'always'); |
| 8 | 8 | |
| 9 | -P::macro('T', function (): callable { |
|
| 9 | +P::macro('T', function(): callable { |
|
| 10 | 10 | return P::always(true); |
| 11 | 11 | }); |
| 12 | 12 | |
@@ -4,6 +4,6 @@ |
||
| 4 | 4 | use Baethon\Phln\Phln as P; |
| 5 | 5 | use Baethon\Phln\FixedArityFn; |
| 6 | 6 | |
| 7 | -P::macro('nAry', function (int $n, callable $fn): callable { |
|
| 7 | +P::macro('nAry', function(int $n, callable $fn): callable { |
|
| 8 | 8 | return FixedArityFn::of($n, $fn); |
| 9 | 9 | }); |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | use Baethon\Phln\Phln as P; |
| 5 | 5 | use Baethon\Phln\RegExp; |
| 6 | 6 | |
| 7 | -P::macro('split', function ($delimiter, string $text): array { |
|
| 7 | +P::macro('split', function($delimiter, string $text): array { |
|
| 8 | 8 | $result = preg_split((string) RegExp::of($delimiter), $text); |
| 9 | 9 | $error = preg_last_error(); |
| 10 | 10 | |
@@ -3,8 +3,8 @@ discard block |
||
| 3 | 3 | |
| 4 | 4 | use Baethon\Phln\Phln as P; |
| 5 | 5 | |
| 6 | -P::macro('partial', call_user_func(function () { |
|
| 7 | - $mergeArguments = function (array $args, array $innerArgs) { |
|
| 6 | +P::macro('partial', call_user_func(function() { |
|
| 7 | + $mergeArguments = function(array $args, array $innerArgs) { |
|
| 8 | 8 | $mapped = []; |
| 9 | 9 | |
| 10 | 10 | foreach ($args as $value) { |
@@ -18,8 +18,8 @@ discard block |
||
| 18 | 18 | return array_merge($mapped, $innerArgs); |
| 19 | 19 | }; |
| 20 | 20 | |
| 21 | - return function (callable $fn, array $args) use ($mergeArguments): callable { |
|
| 22 | - return function (...$innerArgs) use ($fn, $args, $mergeArguments) { |
|
| 21 | + return function(callable $fn, array $args) use ($mergeArguments): callable { |
|
| 22 | + return function(...$innerArgs) use ($fn, $args, $mergeArguments) { |
|
| 23 | 23 | return $fn(...$mergeArguments($args, $innerArgs)); |
| 24 | 24 | }; |
| 25 | 25 | }; |
@@ -6,9 +6,9 @@ |
||
| 6 | 6 | |
| 7 | 7 | load_macro('type', 'is'); |
| 8 | 8 | |
| 9 | -P::macro('typeCond', call_user_func(function () { |
|
| 9 | +P::macro('typeCond', call_user_func(function() { |
|
| 10 | 10 | $typeToPredicate = P::ifElse('\\is_callable', P::identity(), P::is()); |
| 11 | - $mapRow = function ($row) use ($typeToPredicate) { |
|
| 11 | + $mapRow = function($row) use ($typeToPredicate) { |
|
| 12 | 12 | $p = $typeToPredicate($row[0]); |
| 13 | 13 | return [$p, $row[1]]; |
| 14 | 14 | }; |
@@ -3,14 +3,14 @@ |
||
| 3 | 3 | |
| 4 | 4 | use Baethon\Phln\Phln as P; |
| 5 | 5 | |
| 6 | -P::macro('unique', call_user_func(function () { |
|
| 7 | - $reducer = function ($carry, $item) { |
|
| 6 | +P::macro('unique', call_user_func(function() { |
|
| 7 | + $reducer = function($carry, $item) { |
|
| 8 | 8 | return in_array($item, $carry, true) |
| 9 | 9 | ? $carry |
| 10 | 10 | : P::append($item, $carry); |
| 11 | 11 | }; |
| 12 | 12 | |
| 13 | - return function (array $list) use ($reducer): array { |
|
| 13 | + return function(array $list) use ($reducer): array { |
|
| 14 | 14 | return array_reduce($list, $reducer, []); |
| 15 | 15 | }; |
| 16 | 16 | })); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | public function __toString(): string |
| 38 | 38 | { |
| 39 | - return $this->pattern . $this->modifiers; |
|
| 39 | + return $this->pattern.$this->modifiers; |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | private function wrapInDelimiters(string $pattern): string |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | $matches = []; |
| 111 | 111 | preg_match_all((string) $this, $test, $matches, PREG_SET_ORDER); |
| 112 | 112 | |
| 113 | - $slice = function ($list) { |
|
| 113 | + $slice = function($list) { |
|
| 114 | 114 | return count($list) > 1 |
| 115 | 115 | ? array_slice($list, 1) |
| 116 | 116 | : $list; |