@@ -4,7 +4,7 @@ |
||
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | use function Baethon\Phln\assert_object; |
6 | 6 | |
7 | -P::macro('omit', function (array $omitKeys, $object): array { |
|
7 | +P::macro('omit', function(array $omitKeys, $object): array { |
|
8 | 8 | assert_object($object); |
9 | 9 | |
10 | 10 | return array_diff_key((array) $object, array_combine($omitKeys, $omitKeys) ?: []); |
@@ -4,13 +4,13 @@ |
||
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | use function Baethon\Phln\assert_object; |
6 | 6 | |
7 | -P::macro('where', function (array $predicates, $object): bool { |
|
7 | +P::macro('where', function(array $predicates, $object): bool { |
|
8 | 8 | assert_object($object); |
9 | 9 | |
10 | 10 | $keys = P::keys($predicates); |
11 | 11 | |
12 | 12 | return P::all( |
13 | - function ($key) use ($object, $predicates) { |
|
13 | + function($key) use ($object, $predicates) { |
|
14 | 14 | $value = P::prop($key, $object); |
15 | 15 | return $predicates[$key]($value); |
16 | 16 | }, |
@@ -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; |
@@ -31,6 +31,6 @@ |
||
31 | 31 | : [$name]; |
32 | 32 | |
33 | 33 | foreach ($names as $filename) { |
34 | - require_once(__DIR__ . "/macros/{$ns}/{$filename}.php"); |
|
34 | + require_once(__DIR__."/macros/{$ns}/{$filename}.php"); |
|
35 | 35 | } |
36 | 36 | } |
@@ -3,10 +3,10 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('lens', function (callable $getter, callable $setter) { |
|
7 | - return P::curryN(2, function (callable $toFunctorFn, $target) use ($getter, $setter) { |
|
6 | +P::macro('lens', function(callable $getter, callable $setter) { |
|
7 | + return P::curryN(2, function(callable $toFunctorFn, $target) use ($getter, $setter) { |
|
8 | 8 | return P::map( |
9 | - function ($focus) use ($target, $setter) { |
|
9 | + function($focus) use ($target, $setter) { |
|
10 | 10 | return $setter($focus, $target); |
11 | 11 | }, |
12 | 12 | $toFunctorFn($getter($target)) |
@@ -4,9 +4,9 @@ |
||
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | use Baethon\Phln\Monad\Constant; |
6 | 6 | |
7 | -P::macro('view', function (callable $lens, $targetData) { |
|
7 | +P::macro('view', function(callable $lens, $targetData) { |
|
8 | 8 | return $lens( |
9 | - function ($value) { |
|
9 | + function($value) { |
|
10 | 10 | return new Constant($value); |
11 | 11 | }, |
12 | 12 | $targetData |
@@ -4,7 +4,7 @@ |
||
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | use function Baethon\Phln\assert_object; |
6 | 6 | |
7 | -P::macro('has', function (string $prop, $object) { |
|
7 | +P::macro('has', function(string $prop, $object) { |
|
8 | 8 | assert_object($object); |
9 | 9 | |
10 | 10 | return is_object($object) |
@@ -3,6 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('set', function (callable $lens, $value, $targetData) { |
|
6 | +P::macro('set', function(callable $lens, $value, $targetData) { |
|
7 | 7 | return P::over($lens, P::always($value), $targetData); |
8 | 8 | }); |