Passed
Pull Request — master (#14)
by Paweł
02:31
created
src/Scalp/PatternMatching/Pattern/Bind.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Scalp/PatternMatching/Pattern/Value.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Scalp/PatternMatching/Pattern/Any.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Scalp/PatternMatching/Exception/PatternMatchingSubjectNotFound.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Scalp/PatternMatching/Exception/InvalidPatternsNumber.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
example/pattern-matching.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Scalp/PatternMatching/Pattern/Type.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
example/simple_pattern_matching.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 
@@ -15,60 +15,60 @@  discard block
 block discarded – undo
15 15
 
16 16
 function returnString(string $s): callable
17 17
 {
18
-    return function () use ($s): string {
18
+    return function() use ($s): string {
19 19
         return $s;
20 20
     };
21 21
 }
22 22
 
23 23
 $res0 = match(42)
24
-    ->case(Any(), function (): string { return 'Anything'; })
24
+    ->case(Any(), function(): string { return 'Anything'; })
25 25
     ->done();
26 26
 
27 27
 println($res0);
28 28
 
29 29
 $res1 = match(Some(42))
30
-    ->case(Any(), function (): string { return 'Anything'; })
30
+    ->case(Any(), function(): string { return 'Anything'; })
31 31
     ->done();
32 32
 
33 33
 println($res1);
34 34
 
35 35
 $res2 = match(42)
36
-    ->case(Value(13), function (): string { return 'Number 13'; })
37
-    ->case(Value('42'), function (): string { return 'String "42"'; })
38
-    ->case(Value(42), function (): string { return 'Number 42'; })
39
-    ->case(Any(), function (): string { return 'Fallback'; })
36
+    ->case(Value(13), function(): string { return 'Number 13'; })
37
+    ->case(Value('42'), function(): string { return 'String "42"'; })
38
+    ->case(Value(42), function(): string { return 'Number 42'; })
39
+    ->case(Any(), function(): string { return 'Fallback'; })
40 40
     ->done();
41 41
 
42 42
 println($res2);
43 43
 
44 44
 $res3 = match(Some(42))
45
-    ->case(Value(Some(13)), function (): string { return 'Some 13'; })
46
-    ->case(Value(Some(42)), function (): string { return 'Some 42'; })
47
-    ->case(Any(), function (): string { return 'Fallback'; })
45
+    ->case(Value(Some(13)), function(): string { return 'Some 13'; })
46
+    ->case(Value(Some(42)), function(): string { return 'Some 42'; })
47
+    ->case(Any(), function(): string { return 'Fallback'; })
48 48
     ->done();
49 49
 
50 50
 println($res3);
51 51
 
52 52
 $res4 = match(Some(42))
53
-    ->case(Value(Some(13)), function (): string { return 'Some 13'; })
54
-    ->case(Value(Some('42')), function (): string { return 'Some 42'; })
55
-    ->case(Any(), function (): string { return 'Fallback'; })
53
+    ->case(Value(Some(13)), function(): string { return 'Some 13'; })
54
+    ->case(Value(Some('42')), function(): string { return 'Some 42'; })
55
+    ->case(Any(), function(): string { return 'Fallback'; })
56 56
     ->done();
57 57
 
58 58
 println($res4);
59 59
 
60 60
 $res5 = match(42)
61
-    ->case(Type('string'), function (): string { return 'String'; })
62
-    ->case(Type('integer'), function (): string { return 'Integer'; })
63
-    ->case(Any(), function (): string { return 'Not integer'; })
61
+    ->case(Type('string'), function(): string { return 'String'; })
62
+    ->case(Type('integer'), function(): string { return 'Integer'; })
63
+    ->case(Any(), function(): string { return 'Not integer'; })
64 64
     ->done();
65 65
 
66 66
 println($res5);
67 67
 
68 68
 $res6 = match(Some(42))
69
-    ->case(Type(None::class), function (): string { return 'None'; })
70
-    ->case(Type(Some::class), function (): string { return 'Some'; })
71
-    ->case(Any(), function (): string { return 'Neither'; })
69
+    ->case(Type(None::class), function(): string { return 'None'; })
70
+    ->case(Type(Some::class), function(): string { return 'Some'; })
71
+    ->case(Any(), function(): string { return 'Neither'; })
72 72
     ->done();
73 73
 
74 74
 println($res6);
Please login to merge, or discard this patch.