@@ -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\Git; |
| 6 | 6 | |
@@ -26,10 +26,10 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | public function setUp() : void |
| 28 | 28 | { |
| 29 | - $tmpGitRepo = sys_get_temp_dir() . '/api-compare-' . uniqid('tmpGitRepo', true); |
|
| 29 | + $tmpGitRepo = sys_get_temp_dir().'/api-compare-'.uniqid('tmpGitRepo', true); |
|
| 30 | 30 | mkdir($tmpGitRepo, 0777, true); |
| 31 | 31 | (new Process(['git', 'init']))->setWorkingDirectory($tmpGitRepo)->mustRun(); |
| 32 | - file_put_contents($tmpGitRepo . '/test', uniqid('testContent', true)); |
|
| 32 | + file_put_contents($tmpGitRepo.'/test', uniqid('testContent', true)); |
|
| 33 | 33 | (new Process(['git', 'add', '.']))->setWorkingDirectory($tmpGitRepo)->mustRun(); |
| 34 | 34 | (new Process(['git', 'commit', '-m', '"whatever"']))->setWorkingDirectory($tmpGitRepo)->mustRun(); |
| 35 | 35 | $this->repoPath = CheckedOutRepository::fromPath($tmpGitRepo); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | self::assertSame( |
| 53 | 53 | ['1.0.0'], |
| 54 | 54 | array_map( |
| 55 | - function (Version $version) { |
|
| 55 | + function(Version $version) { |
|
| 56 | 56 | return $version->getVersionString(); |
| 57 | 57 | }, |
| 58 | 58 | iterator_to_array((new GetVersionCollectionFromGitRepository())->fromRepository($this->repoPath)) |
@@ -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; |
| 6 | 6 | |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | { |
| 18 | 18 | $changeText = uniqid('changeText', true); |
| 19 | 19 | self::assertSame( |
| 20 | - ' ADDED: ' . $changeText, |
|
| 20 | + ' ADDED: '.$changeText, |
|
| 21 | 21 | (string) Change::added($changeText, false) |
| 22 | 22 | ); |
| 23 | 23 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | $changeText = uniqid('changeText', true); |
| 28 | 28 | self::assertSame( |
| 29 | - '[BC] ADDED: ' . $changeText, |
|
| 29 | + '[BC] ADDED: '.$changeText, |
|
| 30 | 30 | (string) Change::added($changeText, true) |
| 31 | 31 | ); |
| 32 | 32 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | { |
| 36 | 36 | $changeText = uniqid('changeText', true); |
| 37 | 37 | self::assertSame( |
| 38 | - ' CHANGED: ' . $changeText, |
|
| 38 | + ' CHANGED: '.$changeText, |
|
| 39 | 39 | (string) Change::changed($changeText, false) |
| 40 | 40 | ); |
| 41 | 41 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | $changeText = uniqid('changeText', true); |
| 46 | 46 | self::assertSame( |
| 47 | - '[BC] CHANGED: ' . $changeText, |
|
| 47 | + '[BC] CHANGED: '.$changeText, |
|
| 48 | 48 | (string) Change::changed($changeText, true) |
| 49 | 49 | ); |
| 50 | 50 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | $changeText = uniqid('changeText', true); |
| 55 | 55 | self::assertSame( |
| 56 | - ' REMOVED: ' . $changeText, |
|
| 56 | + ' REMOVED: '.$changeText, |
|
| 57 | 57 | (string) Change::removed($changeText, false) |
| 58 | 58 | ); |
| 59 | 59 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | { |
| 63 | 63 | $changeText = uniqid('changeText', true); |
| 64 | 64 | self::assertSame( |
| 65 | - '[BC] REMOVED: ' . $changeText, |
|
| 65 | + '[BC] REMOVED: '.$changeText, |
|
| 66 | 66 | (string) Change::removed($changeText, true) |
| 67 | 67 | ); |
| 68 | 68 | } |
@@ -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 ( |
|
| 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 |
||
| 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 | } |
@@ -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,7 +19,7 @@ discard block |
||
| 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 |
||
| 28 | 28 | return array_key_exists($constantName, $toValues) && $constantValue !== $toValues[$constantName]; |
| 29 | 29 | }, \ARRAY_FILTER_USE_BOTH)); |
| 30 | 30 | |
| 31 | - return Changes::fromArray(array_values(array_map(function (string $constantName) use ($fromClass) : Change { |
|
| 31 | + return Changes::fromArray(array_values(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 |
||
| 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 | } |
@@ -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 | |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | return array_merge( |
| 221 | 221 | [[null]], |
| 222 | 222 | array_merge(...array_map( |
| 223 | - function (string $type) : array { |
|
| 223 | + function(string $type) : array { |
|
| 224 | 224 | return [ |
| 225 | 225 | [ReflectionType::createFromType($type, false)], |
| 226 | 226 | [ReflectionType::createFromType($type, true)], |
@@ -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\Variance; |
| 6 | 6 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | return false; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if ($comparedType->allowsNull() && ! $type->allowsNull()) { |
|
| 36 | + if ($comparedType->allowsNull() && !$type->allowsNull()) { |
|
| 37 | 37 | return false; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | return false; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - if (strtolower($typeAsString) === 'object' && ! $comparedType->isBuiltin()) { |
|
| 52 | + if (strtolower($typeAsString) === 'object' && !$comparedType->isBuiltin()) { |
|
| 53 | 53 | // `object` is not covariant to a defined class type |
| 54 | 54 | return true; |
| 55 | 55 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | return true; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - if (strtolower($typeAsString) === 'iterable' && ! $comparedType->isBuiltin()) { |
|
| 62 | + if (strtolower($typeAsString) === 'iterable' && !$comparedType->isBuiltin()) { |
|
| 63 | 63 | /** @var ReflectionClass $comparedTypeReflectionClass */ |
| 64 | 64 | $comparedTypeReflectionClass = $reflector->reflect($comparedTypeAsString); |
| 65 | 65 | |
@@ -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\Variance; |
| 6 | 6 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | return false; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - if ($type->allowsNull() && ! $comparedType->allowsNull()) { |
|
| 35 | + if ($type->allowsNull() && !$comparedType->allowsNull()) { |
|
| 36 | 36 | return false; |
| 37 | 37 | } |
| 38 | 38 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | return true; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - if (strtolower($comparedTypeAsString) === 'object' && ! $type->isBuiltin()) { |
|
| 51 | + if (strtolower($comparedTypeAsString) === 'object' && !$type->isBuiltin()) { |
|
| 52 | 52 | // `object` is always contravariant to any object type |
| 53 | 53 | return true; |
| 54 | 54 | } |
@@ -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 | |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | return array_merge( |
| 221 | 221 | [[null]], |
| 222 | 222 | array_merge(...array_map( |
| 223 | - function (string $type) : array { |
|
| 223 | + function(string $type) : array { |
|
| 224 | 224 | return [ |
| 225 | 225 | [ReflectionType::createFromType($type, false)], |
| 226 | 226 | [ReflectionType::createFromType($type, true)], |