@@ -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 Roave\ApiCompare\Comparator\BackwardsCompatibility\ClassBased; |
6 | 6 | |
@@ -21,7 +21,7 @@ discard block |
||
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() |
@@ -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 Roave\ApiCompare\Comparator\BackwardsCompatibility\ClassBased; |
6 | 6 | |
@@ -21,7 +21,7 @@ discard block |
||
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 |
||
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 |
@@ -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 Roave\ApiCompare\Comparator\BackwardsCompatibility\ClassBased; |
6 | 6 | |
@@ -29,20 +29,20 @@ discard block |
||
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 |
||
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 | } |
@@ -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 Roave\ApiCompare\Comparator\BackwardsCompatibility\ClassBased; |
6 | 6 | |
@@ -29,20 +29,20 @@ discard block |
||
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 |
||
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 | } |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | |
4 | 4 | namespace RoaveTest\ApiCompare; |
5 | 5 |