Completed
Pull Request — master (#30)
by Marco
01:47
created
src/Command/ApiCompare.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace Roave\ApiCompare\Command;
5 5
 
@@ -113,14 +113,14 @@  discard block
 block discarded – undo
113 113
         $toRevision = $this->parseRevision->fromStringForRepository($input->getOption('to'), $sourceRepo);
114 114
         $sourcesPath = $input->getArgument('sources-path');
115 115
 
116
-        $output->writeln(sprintf('Comparing from %s to %s...', (string)$fromRevision, (string)$toRevision));
116
+        $output->writeln(sprintf('Comparing from %s to %s...', (string) $fromRevision, (string) $toRevision));
117 117
 
118 118
         $fromPath = $this->git->checkout($sourceRepo, $fromRevision);
119 119
         $toPath = $this->git->checkout($sourceRepo, $toRevision);
120 120
 
121 121
         try {
122
-            $fromSources = $fromPath . '/' . $sourcesPath;
123
-            $toSources   = $toPath . '/' . $sourcesPath;
122
+            $fromSources = $fromPath.'/'.$sourcesPath;
123
+            $toSources   = $toPath.'/'.$sourcesPath;
124 124
 
125 125
             Assert::that($fromSources)->directory();
126 126
             Assert::that($toSources)->directory();
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
                         new MethodVisibilityReduced()
135 135
                     )
136 136
                 ))->compare(
137
-                    $this->reflectorFactory->__invoke((string)$fromPath . '/' . $sourcesPath),
138
-                    $this->reflectorFactory->__invoke((string)$toPath . '/' . $sourcesPath)
137
+                    $this->reflectorFactory->__invoke((string) $fromPath.'/'.$sourcesPath),
138
+                    $this->reflectorFactory->__invoke((string) $toPath.'/'.$sourcesPath)
139 139
                 )
140 140
             );
141 141
         } finally {
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     private function parseRevisionFromInput(InputInterface $input, CheckedOutRepository $repository) : Revision
154 154
     {
155 155
         return $this->parseRevision->fromStringForRepository(
156
-            (string)$input->getOption('from'),
156
+            (string) $input->getOption('from'),
157 157
             $repository
158 158
         );
159 159
     }
Please login to merge, or discard this patch.
src/Comparator/BackwardsCompatibility/ClassBased/MultiClassBased.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 Roave\ApiCompare\Comparator\BackwardsCompatibility\ClassBased;
6 6
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     {
22 22
         return array_reduce(
23 23
             $this->checks,
24
-            function (Changes $changes, ClassBased $check) use ($fromClass, $toClass) : Changes {
24
+            function(Changes $changes, ClassBased $check) use ($fromClass, $toClass) : Changes {
25 25
                 return $changes->mergeWith($check->compare($fromClass, $toClass));
26 26
             },
27 27
             Changes::new()
Please login to merge, or discard this patch.
src/Comparator/BackwardsCompatibility/ClassBased/MethodRemoved.php 1 patch
Spacing   +4 added lines, -4 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
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
             array_change_key_case($this->accessibleMethods($toClass), \CASE_UPPER)
22 22
         );
23 23
 
24
-        return Changes::fromArray(array_values(array_map(function (ReflectionMethod $method) use ($fromClass) : Change {
24
+        return Changes::fromArray(array_values(array_map(function(ReflectionMethod $method) use ($fromClass) : Change {
25 25
             return Change::removed(
26 26
                 sprintf('Method %s#%s() was removed', $fromClass->getName(), $method->getName()),
27 27
                 true
@@ -32,12 +32,12 @@  discard block
 block discarded – undo
32 32
     /** @return ReflectionMethod[] */
33 33
     private function accessibleMethods(ReflectionClass $class) : array
34 34
     {
35
-        $methods = array_filter($class->getMethods(), function (ReflectionMethod $method) : bool {
35
+        $methods = array_filter($class->getMethods(), function(ReflectionMethod $method) : bool {
36 36
             return $method->isPublic() || $method->isProtected();
37 37
         });
38 38
 
39 39
         return array_combine(
40
-            array_map(function (ReflectionMethod $method) : string {
40
+            array_map(function(ReflectionMethod $method) : string {
41 41
                 return $method->getName();
42 42
             }, $methods),
43 43
             $methods
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
 
@@ -29,20 +29,20 @@  discard block
 block discarded – undo
29 29
             array_combine(
30 30
                 array_keys(array_intersect_key($visibilitiesFrom, $visibilitiesTo)),
31 31
                 array_map(
32
-                    function (string $visibilityFrom, string $visibilityTo) : array {
32
+                    function(string $visibilityFrom, string $visibilityTo) : array {
33 33
                         return [$visibilityFrom, $visibilityTo];
34 34
                     },
35 35
                     array_intersect_key($visibilitiesFrom, $visibilitiesTo),
36 36
                     array_intersect_key($visibilitiesTo, $visibilitiesFrom)
37 37
                 )
38 38
             ),
39
-            function (array $visibilities) : bool {
39
+            function(array $visibilities) : bool {
40 40
                 // Note: works because public, protected and private are (luckily) sortable
41 41
                 return $visibilities[0] > $visibilities[1];
42 42
             }
43 43
         );
44 44
 
45
-        return Changes::fromArray(array_values(array_map(function (string $methodName, array $visibilities) use (
45
+        return Changes::fromArray(array_values(array_map(function(string $methodName, array $visibilities) use (
46 46
             $fromClass
47 47
         ) : Change {
48 48
             return Change::changed(
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
         $methods = $class->getMethods();
65 65
 
66 66
         return array_combine(
67
-            array_map(function (ReflectionMethod $method) : string {
67
+            array_map(function(ReflectionMethod $method) : string {
68 68
                 return $method->getName();
69 69
             }, $methods),
70
-            array_map(function (ReflectionMethod $method) : string {
70
+            array_map(function(ReflectionMethod $method) : string {
71 71
                 if ($method->isPublic()) {
72 72
                     return self::VISIBILITY_PUBLIC;
73 73
                 }
Please login to merge, or discard this patch.
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
 
@@ -29,20 +29,20 @@  discard block
 block discarded – undo
29 29
             array_combine(
30 30
                 array_keys(array_intersect_key($visibilitiesFrom, $visibilitiesTo)),
31 31
                 array_map(
32
-                    function (string $visibilityFrom, string $visibilityTo) : array {
32
+                    function(string $visibilityFrom, string $visibilityTo) : array {
33 33
                         return [$visibilityFrom, $visibilityTo];
34 34
                     },
35 35
                     array_intersect_key($visibilitiesFrom, $visibilitiesTo),
36 36
                     array_intersect_key($visibilitiesTo, $visibilitiesFrom)
37 37
                 )
38 38
             ),
39
-            function (array $visibilities) : bool {
39
+            function(array $visibilities) : bool {
40 40
                 // Note: works because public, protected and private are (luckily) sortable
41 41
                 return $visibilities[0] > $visibilities[1];
42 42
             }
43 43
         );
44 44
 
45
-        return Changes::fromArray(array_values(array_map(function (string $propertyName, array $visibilities) use (
45
+        return Changes::fromArray(array_values(array_map(function(string $propertyName, array $visibilities) use (
46 46
             $fromClass
47 47
         ) : Change {
48 48
             return Change::changed(
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     /** @return string[] */
62 62
     private function propertyVisibilities(ReflectionClass $class) : array
63 63
     {
64
-        return array_map(function (ReflectionProperty $property) : string {
64
+        return array_map(function(ReflectionProperty $property) : string {
65 65
             if ($property->isPublic()) {
66 66
                 return self::VISIBILITY_PUBLIC;
67 67
             }
Please login to merge, or discard this patch.