Passed
Push — master ( ad6b9e...d5e511 )
by Rob
02:22
created
Comparator/BackwardsCompatibility/ClassBased/PropertyVisibilityReduced.php 1 patch
Spacing   +5 added lines, -5 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 Roave\ApiCompare\Comparator\BackwardsCompatibility\ClassBased;
6 6
 
@@ -37,19 +37,19 @@  discard block
 block discarded – undo
37 37
             array_combine(
38 38
                 $sharedKeys,
39 39
                 array_map(
40
-                    function (string $propertyName) use ($visibilitiesFrom, $visibilitiesTo) : array {
40
+                    function(string $propertyName) use ($visibilitiesFrom, $visibilitiesTo) : array {
41 41
                         return [$visibilitiesFrom[$propertyName], $visibilitiesTo[$propertyName]];
42 42
                     },
43 43
                     $sharedKeys
44 44
                 )
45 45
             ),
46
-            function (array $visibilities) : bool {
46
+            function(array $visibilities) : bool {
47 47
                 // Note: works because the strings "public", "protected" and "private" can be compared directly as they sort correctly for our purposes
48 48
                 return $visibilities[0] > $visibilities[1];
49 49
             }
50 50
         );
51 51
 
52
-        return Changes::fromArray(array_values(array_map(function (
52
+        return Changes::fromArray(array_values(array_map(function(
53 53
             string $propertyName,
54 54
             array $visibilities
55 55
         ) use (
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     /** @return string[] */
72 72
     private function propertyVisibilities(ReflectionClass $class) : array
73 73
     {
74
-        return array_map(function (ReflectionProperty $property) : string {
74
+        return array_map(function(ReflectionProperty $property) : string {
75 75
             if ($property->isPublic()) {
76 76
                 return self::VISIBILITY_PUBLIC;
77 77
             }
Please login to merge, or discard this patch.
Comparator/BackwardsCompatibility/ClassBased/MethodVisibilityReduced.php 1 patch
Spacing   +6 added lines, -6 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 Roave\ApiCompare\Comparator\BackwardsCompatibility\ClassBased;
6 6
 
@@ -37,19 +37,19 @@  discard block
 block discarded – undo
37 37
             array_combine(
38 38
                 $sharedKeys,
39 39
                 array_map(
40
-                    function (string $propertyName) use ($visibilitiesFrom, $visibilitiesTo) : array {
40
+                    function(string $propertyName) use ($visibilitiesFrom, $visibilitiesTo) : array {
41 41
                         return [$visibilitiesFrom[$propertyName], $visibilitiesTo[$propertyName]];
42 42
                     },
43 43
                     $sharedKeys
44 44
                 )
45 45
             ),
46
-            function (array $visibilities) : bool {
46
+            function(array $visibilities) : bool {
47 47
                 // Note: works because the strings "public", "protected" and "private" can be compared directly as they sort correctly for our purposes
48 48
                 return $visibilities[0] > $visibilities[1];
49 49
             }
50 50
         );
51 51
 
52
-        return Changes::fromArray(array_values(array_map(function (
52
+        return Changes::fromArray(array_values(array_map(function(
53 53
             string $methodName,
54 54
             array $visibilities
55 55
         ) use (
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
         $methods = $class->getMethods();
75 75
 
76 76
         return array_combine(
77
-            array_map(function (ReflectionMethod $method) : string {
77
+            array_map(function(ReflectionMethod $method) : string {
78 78
                 return $method->getName();
79 79
             }, $methods),
80
-            array_map(function (ReflectionMethod $method) : string {
80
+            array_map(function(ReflectionMethod $method) : string {
81 81
                 if ($method->isPublic()) {
82 82
                     return self::VISIBILITY_PUBLIC;
83 83
                 }
Please login to merge, or discard this patch.
src/Comparator/BackwardsCompatibility/ClassBased/ConstantValueChanged.php 1 patch
Spacing   +5 added lines, -5 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 Roave\ApiCompare\Comparator\BackwardsCompatibility\ClassBased;
6 6
 
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
         $fromValues = $this->accessibleConstantValues($fromClass);
20 20
         $toValues   = $this->accessibleConstantValues($toClass);
21 21
 
22
-        $changedConstants = array_keys(array_filter($fromValues, function (
22
+        $changedConstants = array_keys(array_filter($fromValues, function(
23 23
             $constantValue,
24 24
             string $constantName
25 25
         ) use (
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
             return array_key_exists($constantName, $toValues) && $constantValue !== $toValues[$constantName];
29 29
         }, \ARRAY_FILTER_USE_BOTH));
30 30
 
31
-        return Changes::fromArray(array_map(function (string $constantName) use ($fromClass) : Change {
31
+        return Changes::fromArray(array_map(function(string $constantName) use ($fromClass) : Change {
32 32
             return Change::changed(
33 33
                 sprintf('Value of constant %s::%s changed', $fromClass->getName(), $constantName),
34 34
                 true
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
     {
42 42
         $accessibleConstants = array_filter(
43 43
             $class->getReflectionConstants(),
44
-            function (ReflectionClassConstant $constant) : bool {
44
+            function(ReflectionClassConstant $constant) : bool {
45 45
                 return $constant->isPublic() || $constant->isProtected();
46 46
             }
47 47
         );
48 48
 
49
-        return array_map(function (ReflectionClassConstant $constant) {
49
+        return array_map(function(ReflectionClassConstant $constant) {
50 50
             return $constant->getValue();
51 51
         }, $accessibleConstants);
52 52
     }
Please login to merge, or discard this patch.
Comparator/BackwardsCompatibility/ClassBased/ConstantVisibilityReduced.php 1 patch
Spacing   +5 added lines, -5 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 Roave\ApiCompare\Comparator\BackwardsCompatibility\ClassBased;
6 6
 
@@ -30,19 +30,19 @@  discard block
 block discarded – undo
30 30
             array_combine(
31 31
                 $sharedKeys,
32 32
                 array_map(
33
-                    function (string $propertyName) use ($visibilitiesFrom, $visibilitiesTo) : array {
33
+                    function(string $propertyName) use ($visibilitiesFrom, $visibilitiesTo) : array {
34 34
                         return [$visibilitiesFrom[$propertyName], $visibilitiesTo[$propertyName]];
35 35
                     },
36 36
                     $sharedKeys
37 37
                 )
38 38
             ),
39
-            function (array $visibilities) : bool {
39
+            function(array $visibilities) : bool {
40 40
                 // Note: works because the strings "public", "protected" and "private" can be compared directly as they sort correctly for our purposes
41 41
                 return $visibilities[0] > $visibilities[1];
42 42
             }
43 43
         );
44 44
 
45
-        return Changes::fromArray(array_values(array_map(function (
45
+        return Changes::fromArray(array_values(array_map(function(
46 46
             string $propertyName,
47 47
             array $visibilities
48 48
         ) use (
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     /** @return string[] indexed by constant name */
65 65
     private function constantVisibilities(ReflectionClass $class) : array
66 66
     {
67
-        return array_map(function (ReflectionClassConstant $constant) : string {
67
+        return array_map(function(ReflectionClassConstant $constant) : string {
68 68
             if ($constant->isPublic()) {
69 69
                 return self::VISIBILITY_PUBLIC;
70 70
             }
Please login to merge, or discard this patch.