@@ -7,17 +7,17 @@ discard block |
||
7 | 7 | load_macro('type', 'is'); |
8 | 8 | load_macro('logic', 'cond'); |
9 | 9 | |
10 | -P::macro('both', call_user_func(function () { |
|
10 | +P::macro('both', call_user_func(function() { |
|
11 | 11 | $allPrimitives = P::unapply(P::all(P::is('bool'))); |
12 | 12 | $allCallables = P::unapply(P::all(P::is('callable'))); |
13 | 13 | |
14 | - $bothPredicate = function ($left, $right) { |
|
15 | - return function (...$args) use ($left, $right) { |
|
14 | + $bothPredicate = function($left, $right) { |
|
15 | + return function(...$args) use ($left, $right) { |
|
16 | 16 | return $left(...$args) && $right(...$args); |
17 | 17 | }; |
18 | 18 | }; |
19 | 19 | |
20 | - $compareBooleans = function ($left, $right) { |
|
20 | + $compareBooleans = function($left, $right) { |
|
21 | 21 | return $left && $right; |
22 | 22 | }; |
23 | 23 | |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | [P::ref('otherwise'), P::throwException(\InvalidArgumentException::class, [])], |
28 | 28 | ]); |
29 | 29 | |
30 | - return function ($left, $right) use ($both) { |
|
30 | + return function($left, $right) use ($both) { |
|
31 | 31 | return $both($left, $right); |
32 | 32 | }; |
33 | 33 | })); |
@@ -4,6 +4,6 @@ |
||
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 | return preg_split((string) RegExp::of($delimiter), $text); |
9 | 9 | }); |
@@ -4,7 +4,7 @@ |
||
4 | 4 | use Baethon\Phln\RegExp; |
5 | 5 | use Baethon\Phln\Phln as P; |
6 | 6 | |
7 | -P::macro('match', function ($regexp, string $test) { |
|
7 | +P::macro('match', function($regexp, string $test) { |
|
8 | 8 | $r = RegExp::of($regexp); |
9 | 9 | $matches = $r->matchAll($test); |
10 | 10 |
@@ -4,6 +4,6 @@ |
||
4 | 4 | use Baethon\Phln\RegExp; |
5 | 5 | use Baethon\Phln\Phln as P; |
6 | 6 | |
7 | -P::macro('regexp', function (string $regexp): RegExp { |
|
7 | +P::macro('regexp', function(string $regexp): RegExp { |
|
8 | 8 | return RegExp::fromString($regexp); |
9 | 9 | }); |
@@ -4,7 +4,7 @@ |
||
4 | 4 | use Baethon\Phln\RegExp; |
5 | 5 | use Baethon\Phln\Phln as P; |
6 | 6 | |
7 | -P::macro('replace', function ($regexp, string $replacement, string $text): string { |
|
7 | +P::macro('replace', function($regexp, string $replacement, string $text): string { |
|
8 | 8 | $r = RegExp::of($regexp); |
9 | 9 | $limit = $r->isGlobal() ? -1 : 1; |
10 | 10 |
@@ -4,6 +4,6 @@ |
||
4 | 4 | use Baethon\Phln\RegExp; |
5 | 5 | use Baethon\Phln\Phln as P; |
6 | 6 | |
7 | -P::macro('test', function ($regexp, string $string): bool { |
|
7 | +P::macro('test', function($regexp, string $string): bool { |
|
8 | 8 | return RegExp::of($regexp)->test($string); |
9 | 9 | }); |
@@ -3,6 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('dec', function ($number) { |
|
6 | +P::macro('dec', function($number) { |
|
7 | 7 | return $number - 1; |
8 | 8 | }); |
@@ -3,6 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('inc', function ($number) { |
|
6 | +P::macro('inc', function($number) { |
|
7 | 7 | return $number + 1; |
8 | 8 | }); |
@@ -3,6 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('modulo', function ($a, $b) { |
|
6 | +P::macro('modulo', function($a, $b) { |
|
7 | 7 | return $a % $b; |
8 | 8 | }); |