@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | { |
| 18 | 18 | public function __invoke(ReflectionClass $fromTrait, ReflectionClass $toTrait) : Changes |
| 19 | 19 | { |
| 20 | - if ($this->isClass($fromTrait) || ! $this->isClass($toTrait)) { |
|
| 20 | + if ($this->isClass($fromTrait) || !$this->isClass($toTrait)) { |
|
| 21 | 21 | return Changes::empty(); |
| 22 | 22 | } |
| 23 | 23 | |
@@ -32,6 +32,6 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | private function isClass(ReflectionClass $class) : bool |
| 34 | 34 | { |
| 35 | - return ! ($class->isTrait() || $class->isInterface()); |
|
| 35 | + return !($class->isTrait() || $class->isInterface()); |
|
| 36 | 36 | } |
| 37 | 37 | } |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | |
| 20 | 20 | public function __invoke(ReflectionProperty $fromProperty, ReflectionProperty $toProperty) : Changes |
| 21 | 21 | { |
| 22 | - if (! $fromProperty->isProtected()) { |
|
| 22 | + if (!$fromProperty->isProtected()) { |
|
| 23 | 23 | return Changes::empty(); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | |
| 20 | 20 | public function __invoke(ReflectionProperty $fromProperty, ReflectionProperty $toProperty) : Changes |
| 21 | 21 | { |
| 22 | - if (! $fromProperty->isPublic()) { |
|
| 22 | + if (!$fromProperty->isPublic()) { |
|
| 23 | 23 | return Changes::empty(); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | return false; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - if ($comparedType->allowsNull() && ! $type->allowsNull()) { |
|
| 33 | + if ($comparedType->allowsNull() && !$type->allowsNull()) { |
|
| 34 | 34 | return false; |
| 35 | 35 | } |
| 36 | 36 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | return false; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - if (strtolower($typeAsString) === 'object' && ! $comparedType->isBuiltin()) { |
|
| 49 | + if (strtolower($typeAsString) === 'object' && !$comparedType->isBuiltin()) { |
|
| 50 | 50 | // `object` is not covariant to a defined class type |
| 51 | 51 | return true; |
| 52 | 52 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | return true; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - if (strtolower($typeAsString) === 'iterable' && ! $comparedType->isBuiltin()) { |
|
| 59 | + if (strtolower($typeAsString) === 'iterable' && !$comparedType->isBuiltin()) { |
|
| 60 | 60 | if ($comparedType->targetReflectionClass()->implementsInterface(\Traversable::class)) { |
| 61 | 61 | // `iterable` can be restricted via any `Iterator` implementation |
| 62 | 62 | return true; |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | return false; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - if ($type->allowsNull() && ! $comparedType->allowsNull()) { |
|
| 32 | + if ($type->allowsNull() && !$comparedType->allowsNull()) { |
|
| 33 | 33 | return false; |
| 34 | 34 | } |
| 35 | 35 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | return true; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - if (strtolower($comparedTypeAsString) === 'object' && ! $type->isBuiltin()) { |
|
| 48 | + if (strtolower($comparedTypeAsString) === 'object' && !$type->isBuiltin()) { |
|
| 49 | 49 | // `object` is always contravariant to any object type |
| 50 | 50 | return true; |
| 51 | 51 | } |
@@ -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); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | private function getTags() : array |
| 50 | 50 | { |
| 51 | 51 | return array_map( |
| 52 | - function (Version $version) { |
|
| 52 | + function(Version $version) { |
|
| 53 | 53 | return $version->getVersionString(); |
| 54 | 54 | }, |
| 55 | 55 | iterator_to_array((new GetVersionCollectionFromGitRepository())->fromRepository($this->repoPath)) |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | self::assertSame( |
| 38 | 38 | $expectedVersion, |
| 39 | 39 | (new PickLastMinorVersionFromCollection())->forVersions( |
| 40 | - new VersionsCollection(...array_map(function (string $version) : Version { |
|
| 40 | + new VersionsCollection(...array_map(function(string $version) : Version { |
|
| 41 | 41 | return Version::fromString($version); |
| 42 | 42 | }, $collectionOfVersions)) |
| 43 | 43 | )->getVersionString() |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | ->getOutput(); |
| 32 | 32 | |
| 33 | 33 | return new VersionsCollection(...array_filter( |
| 34 | - array_map(function (string $maybeVersion) : ?Version { |
|
| 34 | + array_map(function(string $maybeVersion) : ?Version { |
|
| 35 | 35 | try { |
| 36 | 36 | return Version::fromString($maybeVersion); |
| 37 | 37 | } catch (InvalidVersionStringException $e) { |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | protected function createLocatedSource(Identifier $identifier) : ?LocatedSource |
| 36 | 36 | { |
| 37 | - if (! $identifier->isClass()) { |
|
| 37 | + if (!$identifier->isClass()) { |
|
| 38 | 38 | return null; |
| 39 | 39 | } |
| 40 | 40 | |