@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('isEmpty', function ($value): bool { |
|
6 | +P::macro('isEmpty', function($value): bool { |
|
7 | 7 | switch (gettype($value)) { |
8 | 8 | case 'array': |
9 | 9 | return [] === $value; |
@@ -3,6 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('not', function ($value): bool { |
|
6 | +P::macro('not', function($value): bool { |
|
7 | 7 | return !$value; |
8 | 8 | }); |
@@ -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,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 | }); |