@@ -3,6 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('defaultTo', function ($default, $value) { |
|
6 | +P::macro('defaultTo', function($default, $value) { |
|
7 | 7 | return is_null($value) ? $default : $value; |
8 | 8 | }); |
@@ -3,8 +3,8 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('ifElse', function (callable $predicate, callable $onTrue, callable $onFalse): \Closure { |
|
7 | - return function (...$args) use ($predicate, $onTrue, $onFalse) { |
|
6 | +P::macro('ifElse', function(callable $predicate, callable $onTrue, callable $onFalse): \Closure { |
|
7 | + return function(...$args) use ($predicate, $onTrue, $onFalse) { |
|
8 | 8 | return $predicate(...$args) |
9 | 9 | ? $onTrue(...$args) |
10 | 10 | : $onFalse(...$args); |
@@ -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 | }); |