@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Scalp; |
6 | 6 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Scalp; |
6 | 6 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | return $this->isEmpty() || $p($this->get()); |
75 | 75 | } |
76 | 76 | |
77 | - final public function foreach(callable $f): void |
|
77 | + final public function foreach (callable $f): void |
|
78 | 78 | { |
79 | 79 | $this->isEmpty() ?: $f($this->get()); |
80 | 80 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Scalp\Example { |
6 | 6 | use function Scalp\None; |
@@ -21,19 +21,19 @@ discard block |
||
21 | 21 | |
22 | 22 | $option = Option(42); |
23 | 23 | |
24 | - $square = function (int $x): int { |
|
24 | + $square = function(int $x): int { |
|
25 | 25 | return $x ** 2; |
26 | 26 | }; |
27 | 27 | |
28 | 28 | println($option->map($square)); |
29 | 29 | |
30 | - $isOdd = function (int $x): bool { |
|
30 | + $isOdd = function(int $x): bool { |
|
31 | 31 | return $x % 2 === 1; |
32 | 32 | }; |
33 | 33 | |
34 | 34 | println($option->filter($isOdd)); |
35 | 35 | |
36 | - $squareRoot = function (int $x): Option { |
|
36 | + $squareRoot = function(int $x): Option { |
|
37 | 37 | return $x >= 0 ? Some(sqrt($x)) : None(); |
38 | 38 | }; |
39 | 39 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Scalp; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Scalp\Reflection { |
6 | 6 | function reflectionFunction(callable $f): \ReflectionFunctionAbstract |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Scalp; |
6 | 6 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | { |
33 | 33 | $argsIterator = new \ArrayIterator($arguments); |
34 | 34 | |
35 | - $replacePlaceholders = function ($arg) use ($argsIterator) { |
|
35 | + $replacePlaceholders = function($arg) use ($argsIterator) { |
|
36 | 36 | $replacement = $arg === __ && $argsIterator->valid() |
37 | 37 | ? $argsIterator->current() |
38 | 38 | : $arg; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | 'Partially applied function has %d missing argument%s at position: %s.', |
64 | 64 | \count($placeholders), |
65 | 65 | \count($placeholders) > 1 ? 's' : '', |
66 | - implode(', ', array_map(function (int $idx): int { |
|
66 | + implode(', ', array_map(function(int $idx) : int { |
|
67 | 67 | return $idx + 1; |
68 | 68 | }, array_keys($placeholders))) |
69 | 69 | )); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | { |
75 | 75 | $rf = reflectionFunction($f); |
76 | 76 | |
77 | - [$count, $required] = array_reduce($rf->getParameters(), function (array $carry, \ReflectionParameter $parameter): array { |
|
77 | + [$count, $required] = array_reduce($rf->getParameters(), function(array $carry, \ReflectionParameter $parameter): array { |
|
78 | 78 | $count = $carry[0] + 1; |
79 | 79 | $required = $parameter->isOptional() ? $carry[1] : $count; |
80 | 80 | |
@@ -86,6 +86,6 @@ discard block |
||
86 | 86 | |
87 | 87 | private function placeholderArguments(array $arguments): array |
88 | 88 | { |
89 | - return array_filter($arguments, function ($arg): bool { return $arg === __; }); |
|
89 | + return array_filter($arguments, function($arg): bool { return $arg === __; }); |
|
90 | 90 | } |
91 | 91 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Scalp\Type { |
6 | 6 | use function Scalp\Reflection\reflectionFunction; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | require_once __DIR__.'/../vendor/autoload.php'; |
6 | 6 | |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | use function Scalp\println; |
10 | 10 | use const Scalp\__; |
11 | 11 | |
12 | -$isEven = function (int $x): bool { |
|
12 | +$isEven = function(int $x): bool { |
|
13 | 13 | return $x % 2 === 0; |
14 | 14 | }; |
15 | 15 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Scalp\Collection; |
6 | 6 |