@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('lensProp', function (string $prop) { |
|
6 | +P::macro('lensProp', function(string $prop) { |
|
7 | 7 | return P::lens( |
8 | 8 | P::prop($prop), |
9 | 9 | P::assoc($prop) |
@@ -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('assoc', function (string $key, $value, $object) { |
|
7 | +P::macro('assoc', function(string $key, $value, $object) { |
|
8 | 8 | assert_object($object); |
9 | 9 | |
10 | 10 | if (is_object($object)) { |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | use function Baethon\Phln\assert_object; |
6 | 6 | |
7 | -$clone = function ($object) { |
|
7 | +$clone = function($object) { |
|
8 | 8 | return is_object($object) |
9 | 9 | ? clone $object |
10 | 10 | : $object; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | return $anchor[$key]; |
25 | 25 | }; |
26 | 26 | |
27 | -P::macro('assocPath', function (string $path, $value, $object) use ($clone, $assoc) { |
|
27 | +P::macro('assocPath', function(string $path, $value, $object) use ($clone, $assoc) { |
|
28 | 28 | assert_object($object); |
29 | 29 | |
30 | 30 | $keys = P::split('.', $path); |
@@ -37,14 +37,14 @@ discard block |
||
37 | 37 | $lastProp = P::last($keys); |
38 | 38 | |
39 | 39 | $copy = $clone($object); |
40 | - $anchor =& $copy; |
|
40 | + $anchor = & $copy; |
|
41 | 41 | |
42 | 42 | foreach ($anchorPath as $k) { |
43 | 43 | $node = P::has($k, $anchor) |
44 | 44 | ? $clone(P::prop($k, $anchor)) |
45 | 45 | : []; |
46 | 46 | |
47 | - $anchor =& $assoc($k, $node, $anchor); |
|
47 | + $anchor = & $assoc($k, $node, $anchor); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | $assoc($lastProp, $value, $anchor); |
@@ -4,9 +4,9 @@ |
||
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | use Baethon\Phln\Monad\Identity; |
6 | 6 | |
7 | -P::macro('over', function (callable $lens, callable $fn, $targetData) { |
|
7 | +P::macro('over', function(callable $lens, callable $fn, $targetData) { |
|
8 | 8 | return $lens( |
9 | - function ($value) use ($fn) { |
|
9 | + function($value) use ($fn) { |
|
10 | 10 | return Identity::of($fn($value)); |
11 | 11 | }, |
12 | 12 | $targetData |
@@ -4,7 +4,7 @@ |
||
4 | 4 | use Baethon\Phln\Duck; |
5 | 5 | use Baethon\Phln\Phln as P; |
6 | 6 | |
7 | -P::macro('map', function (callable $fn, $collection) { |
|
7 | +P::macro('map', function(callable $fn, $collection) { |
|
8 | 8 | assert(is_array($collection) || Duck::isFunctor($collection)); |
9 | 9 | |
10 | 10 | return is_array($collection) |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('update', function (int $index, $value, array $collection): array { |
|
6 | +P::macro('update', function(int $index, $value, array $collection): array { |
|
7 | 7 | |
8 | 8 | if (false === array_key_exists($index, $collection)) { |
9 | 9 | return $collection; |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('lensIndex', function (int $index) { |
|
6 | +P::macro('lensIndex', function(int $index) { |
|
7 | 7 | return P::lens( |
8 | 8 | P::nth($index), |
9 | 9 | P::update($index) |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | |
4 | 4 | namespace Baethon\Phln; |
5 | 5 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | |
4 | 4 | namespace Baethon\Phln\Monad; |
5 | 5 |