@@ -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 RoaveTest\ApiCompare\Comparator\BackwardsCompatibility\ClassBased; |
6 | 6 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | self::assertSame( |
31 | 31 | $expectedMessages, |
32 | - array_map(function (Change $change) : string { |
|
32 | + array_map(function(Change $change) : string { |
|
33 | 33 | return $change->__toString(); |
34 | 34 | }, iterator_to_array($changes)) |
35 | 35 | ); |
@@ -43,11 +43,11 @@ discard block |
||
43 | 43 | return [ |
44 | 44 | 'RoaveTestAsset\\ClassWithConstantVisibilitiesBeingChanged' => [ |
45 | 45 | (new ClassReflector(new SingleFileSourceLocator( |
46 | - __DIR__ . '/../../../../asset/api/old/ClassWithConstantVisibilitiesBeingChanged.php', |
|
46 | + __DIR__.'/../../../../asset/api/old/ClassWithConstantVisibilitiesBeingChanged.php', |
|
47 | 47 | $locator |
48 | 48 | )))->reflect('RoaveTestAsset\\ClassWithConstantVisibilitiesBeingChanged'), |
49 | 49 | (new ClassReflector(new SingleFileSourceLocator( |
50 | - __DIR__ . '/../../../../asset/api/new/ClassWithConstantVisibilitiesBeingChanged.php', |
|
50 | + __DIR__.'/../../../../asset/api/new/ClassWithConstantVisibilitiesBeingChanged.php', |
|
51 | 51 | $locator |
52 | 52 | )))->reflect('RoaveTestAsset\\ClassWithConstantVisibilitiesBeingChanged'), |
53 | 53 | [ |
@@ -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 RoaveTest\ApiCompare\Comparator\BackwardsCompatibility\ClassBased; |
6 | 6 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | self::assertSame( |
31 | 31 | $expectedMessages, |
32 | - array_map(function (Change $change) : string { |
|
32 | + array_map(function(Change $change) : string { |
|
33 | 33 | return $change->__toString(); |
34 | 34 | }, iterator_to_array($changes)) |
35 | 35 | ); |
@@ -43,11 +43,11 @@ discard block |
||
43 | 43 | return [ |
44 | 44 | 'RoaveTestAsset\\ClassWithConstantValuesBeingChanged' => [ |
45 | 45 | (new ClassReflector(new SingleFileSourceLocator( |
46 | - __DIR__ . '/../../../../asset/api/old/ClassWithConstantValuesBeingChanged.php', |
|
46 | + __DIR__.'/../../../../asset/api/old/ClassWithConstantValuesBeingChanged.php', |
|
47 | 47 | $locator |
48 | 48 | )))->reflect('RoaveTestAsset\\ClassWithConstantValuesBeingChanged'), |
49 | 49 | (new ClassReflector(new SingleFileSourceLocator( |
50 | - __DIR__ . '/../../../../asset/api/new/ClassWithConstantValuesBeingChanged.php', |
|
50 | + __DIR__.'/../../../../asset/api/new/ClassWithConstantValuesBeingChanged.php', |
|
51 | 51 | $locator |
52 | 52 | )))->reflect('RoaveTestAsset\\ClassWithConstantValuesBeingChanged'), |
53 | 53 | [ |
@@ -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 RoaveTest\ApiCompare\Comparator\BackwardsCompatibility\ClassBased; |
6 | 6 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | self::assertSame( |
31 | 31 | $expectedMessages, |
32 | - array_map(function (Change $change) : string { |
|
32 | + array_map(function(Change $change) : string { |
|
33 | 33 | return $change->__toString(); |
34 | 34 | }, iterator_to_array($changes)) |
35 | 35 | ); |
@@ -43,11 +43,11 @@ discard block |
||
43 | 43 | return [ |
44 | 44 | 'RoaveTestAsset\\ClassWithConstantsBeingRemoved' => [ |
45 | 45 | (new ClassReflector(new SingleFileSourceLocator( |
46 | - __DIR__ . '/../../../../asset/api/old/ClassWithConstantsBeingRemoved.php', |
|
46 | + __DIR__.'/../../../../asset/api/old/ClassWithConstantsBeingRemoved.php', |
|
47 | 47 | $locator |
48 | 48 | )))->reflect('RoaveTestAsset\\ClassWithConstantsBeingRemoved'), |
49 | 49 | (new ClassReflector(new SingleFileSourceLocator( |
50 | - __DIR__ . '/../../../../asset/api/new/ClassWithConstantsBeingRemoved.php', |
|
50 | + __DIR__.'/../../../../asset/api/new/ClassWithConstantsBeingRemoved.php', |
|
51 | 51 | $locator |
52 | 52 | )))->reflect('RoaveTestAsset\\ClassWithConstantsBeingRemoved'), |
53 | 53 | [ |
@@ -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 | $this->accessibleConstants($toClass) |
22 | 22 | ); |
23 | 23 | |
24 | - return Changes::fromArray(array_values(array_map(function (ReflectionClassConstant $constant) use ($fromClass) : Change { |
|
24 | + return Changes::fromArray(array_values(array_map(function(ReflectionClassConstant $constant) use ($fromClass) : Change { |
|
25 | 25 | return Change::removed( |
26 | 26 | sprintf('Constant %s::%s was removed', $fromClass->getName(), $constant->getName()), |
27 | 27 | true |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | /** @return ReflectionClassConstant[] */ |
33 | 33 | private function accessibleConstants(ReflectionClass $class) : array |
34 | 34 | { |
35 | - return array_filter($class->getReflectionConstants(), function (ReflectionClassConstant $constant) : bool { |
|
35 | + return array_filter($class->getReflectionConstants(), function(ReflectionClassConstant $constant) : bool { |
|
36 | 36 | return $constant->isPublic() || $constant->isProtected(); |
37 | 37 | }); |
38 | 38 | } |
@@ -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 | |
@@ -30,19 +30,19 @@ discard block |
||
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 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[] indexed by constant name */ |
62 | 62 | private function constantVisibilities(ReflectionClass $class) : array |
63 | 63 | { |
64 | - return array_map(function (ReflectionClassConstant $constant) : string { |
|
64 | + return array_map(function(ReflectionClassConstant $constant) : string { |
|
65 | 65 | if ($constant->isPublic()) { |
66 | 66 | return self::VISIBILITY_PUBLIC; |
67 | 67 | } |
@@ -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 | |
@@ -19,13 +19,13 @@ discard block |
||
19 | 19 | $fromValues = $this->accessibleConstantValues($fromClass); |
20 | 20 | $toValues = $this->accessibleConstantValues($toClass); |
21 | 21 | |
22 | - $changedConstants = array_keys(array_filter($fromValues, function ($constantValue, string $constantName) use ( |
|
22 | + $changedConstants = array_keys(array_filter($fromValues, function($constantValue, string $constantName) use ( |
|
23 | 23 | $toValues |
24 | 24 | ) : bool { |
25 | 25 | return array_key_exists($constantName, $toValues) && $constantValue !== $toValues[$constantName]; |
26 | 26 | }, \ARRAY_FILTER_USE_BOTH)); |
27 | 27 | |
28 | - return Changes::fromArray(array_values(array_map(function (string $constantName) use ($fromClass) : Change { |
|
28 | + return Changes::fromArray(array_values(array_map(function(string $constantName) use ($fromClass) : Change { |
|
29 | 29 | return Change::changed( |
30 | 30 | sprintf('Value of constant %s::%s changed', $fromClass->getName(), $constantName), |
31 | 31 | true |
@@ -38,12 +38,12 @@ discard block |
||
38 | 38 | { |
39 | 39 | $accessibleConstants = array_filter( |
40 | 40 | $class->getReflectionConstants(), |
41 | - function (ReflectionClassConstant $constant) : bool { |
|
41 | + function(ReflectionClassConstant $constant) : bool { |
|
42 | 42 | return $constant->isPublic() || $constant->isProtected(); |
43 | 43 | } |
44 | 44 | ); |
45 | 45 | |
46 | - return array_map(function (ReflectionClassConstant $constant) { |
|
46 | + return array_map(function(ReflectionClassConstant $constant) { |
|
47 | 47 | return $constant->getValue(); |
48 | 48 | }, $accessibleConstants); |
49 | 49 | } |
@@ -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 | |
@@ -30,19 +30,19 @@ discard block |
||
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 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 | |
@@ -30,19 +30,19 @@ discard block |
||
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 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 | } |