@@ -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_map(function (string $constantName) use ($fromClass) : Change { |
|
| 28 | + return Changes::fromArray(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 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 (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,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 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 (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 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 (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 | } |