@@ -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\PatternMatching\Pattern; |
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\PatternMatching\Pattern; |
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\PatternMatching\Pattern; |
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\PatternMatching\Pattern; |
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\PatternMatching\Exception; |
6 | 6 | |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | final class PatternMatchingSubjectNotFound extends \RuntimeException |
10 | 10 | { |
11 | - public static function for($x): PatternMatchingSubjectNotFound |
|
11 | + public static function for ($x): PatternMatchingSubjectNotFound |
|
12 | 12 | { |
13 | 13 | return new self('Pattern matching subject "'.AnyToString($x).'" is not defined in this match expression".'); |
14 | 14 | } |
@@ -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\PatternMatching\Exception; |
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 | require_once __DIR__.'/../vendor/autoload.php'; |
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\PatternMatching\Pattern; |
6 | 6 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | ->filter(papply(isInstanceOfType, __, $this->type)); |
38 | 38 | |
39 | 39 | if ($typeMatch->isEmpty() || empty($this->patterns)) { |
40 | - return $typeMatch->flatMap(function (): Option { return Some([]); }); |
|
40 | + return $typeMatch->flatMap(function(): Option { return Some([]); }); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** @var TryCatch $caseClass */ |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | ); |
50 | 50 | |
51 | 51 | return $caseClass |
52 | - ->map(function (CaseClass $cc): array { return $cc->deconstruct(); }) |
|
52 | + ->map(function(CaseClass $cc): array { return $cc->deconstruct(); }) |
|
53 | 53 | ->map(papply(\Closure::fromCallable([$this, 'applyConstructorArgumentsPatterns']), type($x), __, $this->patterns)) |
54 | 54 | ->get(); |
55 | 55 | } |
@@ -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 | |
@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | function tupleName(Tuple $tuple): string |
14 | 14 | { |
15 | 15 | return match($tuple) |
16 | - ->case(Type(Tuple::class, Any()), function () { return 'Singleton'; }) |
|
17 | - ->case(Type(Tuple::class, Any(), Any()), function () { return 'Pair'; }) |
|
18 | - ->case(Type(Tuple::class, Any(), Any(), Any()), function () { return 'Triple'; }) |
|
19 | - ->case(Type(Tuple::class), function () { return 'Other tuple'; }) |
|
16 | + ->case(Type(Tuple::class, Any()), function() { return 'Singleton'; }) |
|
17 | + ->case(Type(Tuple::class, Any(), Any()), function() { return 'Pair'; }) |
|
18 | + ->case(Type(Tuple::class, Any(), Any(), Any()), function() { return 'Triple'; }) |
|
19 | + ->case(Type(Tuple::class), function() { return 'Other tuple'; }) |
|
20 | 20 | ->done(); |
21 | 21 | } |
22 | 22 |