@@ -69,13 +69,13 @@ |
||
| 69 | 69 | { |
| 70 | 70 | $optionalParameters = array_values(array_filter( |
| 71 | 71 | $function->getParameters(), |
| 72 | - static function (ReflectionParameter $parameter) : bool { |
|
| 72 | + static function(ReflectionParameter $parameter) : bool { |
|
| 73 | 73 | return $parameter->isDefaultValueAvailable(); |
| 74 | 74 | } |
| 75 | 75 | )); |
| 76 | 76 | |
| 77 | 77 | return array_combine( |
| 78 | - array_map(static function (ReflectionParameter $parameter) : int { |
|
| 78 | + array_map(static function(ReflectionParameter $parameter) : int { |
|
| 79 | 79 | return $parameter->getPosition(); |
| 80 | 80 | }, $optionalParameters), |
| 81 | 81 | $optionalParameters |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | $methods = $class->getMethods(); |
| 50 | 50 | |
| 51 | 51 | return array_combine( |
| 52 | - array_map(static function (ReflectionMethod $method) : string { |
|
| 52 | + array_map(static function(ReflectionMethod $method) : string { |
|
| 53 | 53 | return strtolower($method->getName()); |
| 54 | 54 | }, $methods), |
| 55 | 55 | $methods |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | $this->accessibleConstants($toClass) |
| 24 | 24 | ); |
| 25 | 25 | |
| 26 | - return Changes::fromList(...array_values(array_map(static function (ReflectionClassConstant $constant) use ($fromClass) : Change { |
|
| 26 | + return Changes::fromList(...array_values(array_map(static function(ReflectionClassConstant $constant) use ($fromClass) : Change { |
|
| 27 | 27 | return Change::removed( |
| 28 | 28 | sprintf('Constant %s::%s was removed', $fromClass->getName(), $constant->getName()), |
| 29 | 29 | true |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | /** @return ReflectionClassConstant[] */ |
| 35 | 35 | private function accessibleConstants(ReflectionClass $class) : array |
| 36 | 36 | { |
| 37 | - return array_filter($class->getReflectionConstants(), static function (ReflectionClassConstant $constant) : bool { |
|
| 37 | + return array_filter($class->getReflectionConstants(), static function(ReflectionClassConstant $constant) : bool { |
|
| 38 | 38 | return $constant->isPublic() || $constant->isProtected(); |
| 39 | 39 | }); |
| 40 | 40 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | array_change_key_case($this->accessibleMethods($toClass), CASE_UPPER) |
| 36 | 36 | ); |
| 37 | 37 | |
| 38 | - return Changes::fromList(...array_values(array_map(function (ReflectionMethod $method) : Change { |
|
| 38 | + return Changes::fromList(...array_values(array_map(function(ReflectionMethod $method) : Change { |
|
| 39 | 39 | return Change::removed( |
| 40 | 40 | sprintf('Method %s was removed', $this->formatFunction->__invoke($method)), |
| 41 | 41 | true |
@@ -46,12 +46,12 @@ discard block |
||
| 46 | 46 | /** @return ReflectionMethod[] */ |
| 47 | 47 | private function accessibleMethods(ReflectionClass $class) : array |
| 48 | 48 | { |
| 49 | - $methods = array_filter($class->getMethods(), static function (ReflectionMethod $method) : bool { |
|
| 49 | + $methods = array_filter($class->getMethods(), static function(ReflectionMethod $method) : bool { |
|
| 50 | 50 | return $method->isPublic() || $method->isProtected(); |
| 51 | 51 | }); |
| 52 | 52 | |
| 53 | 53 | return array_combine( |
| 54 | - array_map(static function (ReflectionMethod $method) : string { |
|
| 54 | + array_map(static function(ReflectionMethod $method) : string { |
|
| 55 | 55 | return $method->getName(); |
| 56 | 56 | }, $methods), |
| 57 | 57 | $methods |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | array_keys($this->accessibleProperties($toClass)) |
| 35 | 35 | ); |
| 36 | 36 | |
| 37 | - return Changes::fromList(...array_values(array_map(function (string $property) use ($fromProperties) : Change { |
|
| 37 | + return Changes::fromList(...array_values(array_map(function(string $property) use ($fromProperties) : Change { |
|
| 38 | 38 | return Change::removed( |
| 39 | 39 | sprintf('Property %s was removed', $this->formatProperty->__invoke($fromProperties[$property])), |
| 40 | 40 | true |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | /** @return ReflectionProperty[] */ |
| 46 | 46 | private function accessibleProperties(ReflectionClass $class) : array |
| 47 | 47 | { |
| 48 | - return array_filter($class->getProperties(), static function (ReflectionProperty $property) : bool { |
|
| 48 | + return array_filter($class->getProperties(), static function(ReflectionProperty $property) : bool { |
|
| 49 | 49 | return $property->isPublic() || $property->isProtected(); |
| 50 | 50 | }); |
| 51 | 51 | } |
@@ -23,11 +23,11 @@ discard block |
||
| 23 | 23 | $toMethods = $this->methods($toInterface); |
| 24 | 24 | $newMethods = array_diff_key($toMethods, $fromMethods); |
| 25 | 25 | |
| 26 | - if (! $newMethods) { |
|
| 26 | + if (!$newMethods) { |
|
| 27 | 27 | return Changes::empty(); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - return Changes::fromList(...array_values(array_map(static function (ReflectionMethod $method) use ( |
|
| 30 | + return Changes::fromList(...array_values(array_map(static function(ReflectionMethod $method) use ( |
|
| 31 | 31 | $fromInterface |
| 32 | 32 | ) : Change { |
| 33 | 33 | return Change::added( |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $methods = $interface->getMethods(); |
| 48 | 48 | |
| 49 | 49 | return array_combine( |
| 50 | - array_map(static function (ReflectionMethod $method) : string { |
|
| 50 | + array_map(static function(ReflectionMethod $method) : string { |
|
| 51 | 51 | return strtolower($method->getName()); |
| 52 | 52 | }, $methods), |
| 53 | 53 | $methods |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | return false; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - if ($comparedType->allowsNull() && ! $type->allowsNull()) { |
|
| 34 | + if ($comparedType->allowsNull() && !$type->allowsNull()) { |
|
| 35 | 35 | return false; |
| 36 | 36 | } |
| 37 | 37 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | return false; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if (strtolower($typeAsString) === 'object' && ! $comparedType->isBuiltin()) { |
|
| 50 | + if (strtolower($typeAsString) === 'object' && !$comparedType->isBuiltin()) { |
|
| 51 | 51 | // `object` is not covariant to a defined class type |
| 52 | 52 | return true; |
| 53 | 53 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | return true; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - if (strtolower($typeAsString) === 'iterable' && ! $comparedType->isBuiltin()) { |
|
| 60 | + if (strtolower($typeAsString) === 'iterable' && !$comparedType->isBuiltin()) { |
|
| 61 | 61 | if ($comparedType->targetReflectionClass()->implementsInterface(Traversable::class)) { |
| 62 | 62 | // `iterable` can be restricted via any `Iterator` implementation |
| 63 | 63 | return true; |
@@ -32,11 +32,11 @@ discard block |
||
| 32 | 32 | use Symfony\Component\Console\Output\ConsoleOutput; |
| 33 | 33 | use function file_exists; |
| 34 | 34 | |
| 35 | -(static function () : void { |
|
| 36 | - (static function () : void { |
|
| 35 | +(static function() : void { |
|
| 36 | + (static function() : void { |
|
| 37 | 37 | $autoloaderLocations = [ |
| 38 | - __DIR__ . '/../vendor/autoload.php', // Installed by cloning the project and running `composer install` |
|
| 39 | - __DIR__ . '/../../../autoload.php', // Installed via `composer require` |
|
| 38 | + __DIR__.'/../vendor/autoload.php', // Installed by cloning the project and running `composer install` |
|
| 39 | + __DIR__.'/../../../autoload.php', // Installed via `composer require` |
|
| 40 | 40 | ]; |
| 41 | 41 | |
| 42 | 42 | foreach ($autoloaderLocations as $autoload) { |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | new GetVersionCollectionFromGitRepository(), |
| 66 | 66 | new PickLastMinorVersionFromCollection(), |
| 67 | 67 | new LocateDependenciesViaComposer( |
| 68 | - static function (string $installationPath) use ($composerIo) : Installer { |
|
| 68 | + static function(string $installationPath) use ($composerIo) : Installer { |
|
| 69 | 69 | return Installer::create( |
| 70 | 70 | $composerIo, |
| 71 | 71 | (new Factory())->createComposer( |
@@ -121,20 +121,20 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | unlink($this->sourcesRepository); |
| 123 | 123 | mkdir($this->sourcesRepository); |
| 124 | - mkdir($this->sourcesRepository . '/src'); |
|
| 124 | + mkdir($this->sourcesRepository.'/src'); |
|
| 125 | 125 | |
| 126 | 126 | self::assertDirectoryExists($this->sourcesRepository); |
| 127 | - self::assertDirectoryExists($this->sourcesRepository . '/src'); |
|
| 127 | + self::assertDirectoryExists($this->sourcesRepository.'/src'); |
|
| 128 | 128 | |
| 129 | 129 | (new Process('git init', $this->sourcesRepository))->mustRun(); |
| 130 | 130 | |
| 131 | - file_put_contents($this->sourcesRepository . '/composer.json', self::COMPOSER_MANIFEST); |
|
| 131 | + file_put_contents($this->sourcesRepository.'/composer.json', self::COMPOSER_MANIFEST); |
|
| 132 | 132 | |
| 133 | 133 | (new Process('git add -A', $this->sourcesRepository))->mustRun(); |
| 134 | 134 | (new Process('git commit -am "Initial commit with composer manifest"', $this->sourcesRepository))->mustRun(); |
| 135 | 135 | |
| 136 | 136 | foreach (self::CLASS_VERSIONS as $key => $classCode) { |
| 137 | - file_put_contents($this->sourcesRepository . '/src/TheClass.php', $classCode); |
|
| 137 | + file_put_contents($this->sourcesRepository.'/src/TheClass.php', $classCode); |
|
| 138 | 138 | |
| 139 | 139 | (new Process('git add -A', $this->sourcesRepository))->mustRun(); |
| 140 | 140 | (new Process(sprintf('git commit -am "Class sources v%d"', $key + 1), $this->sourcesRepository))->mustRun(); |
@@ -159,9 +159,9 @@ discard block |
||
| 159 | 159 | { |
| 160 | 160 | $check = new Process( |
| 161 | 161 | [ |
| 162 | - __DIR__ . '/../../../bin/roave-backward-compatibility-check', |
|
| 163 | - '--from=' . $this->versions[0], |
|
| 164 | - '--to=' . $this->versions[1], |
|
| 162 | + __DIR__.'/../../../bin/roave-backward-compatibility-check', |
|
| 163 | + '--from='.$this->versions[0], |
|
| 164 | + '--to='.$this->versions[1], |
|
| 165 | 165 | ], |
| 166 | 166 | $this->sourcesRepository |
| 167 | 167 | ); |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | public function testWillNotRunWithoutTagsNorSpecifiedVersions() : void |
| 182 | 182 | { |
| 183 | 183 | $check = new Process( |
| 184 | - __DIR__ . '/../../../bin/roave-backward-compatibility-check', |
|
| 184 | + __DIR__.'/../../../bin/roave-backward-compatibility-check', |
|
| 185 | 185 | $this->sourcesRepository |
| 186 | 186 | ); |
| 187 | 187 | |
@@ -196,9 +196,9 @@ discard block |
||
| 196 | 196 | { |
| 197 | 197 | $check = new Process( |
| 198 | 198 | [ |
| 199 | - __DIR__ . '/../../../bin/roave-backward-compatibility-check', |
|
| 200 | - '--from=' . $this->versions[0], |
|
| 201 | - '--to=' . $this->versions[3], |
|
| 199 | + __DIR__.'/../../../bin/roave-backward-compatibility-check', |
|
| 200 | + '--from='.$this->versions[0], |
|
| 201 | + '--to='.$this->versions[3], |
|
| 202 | 202 | '-vvv', |
| 203 | 203 | ], |
| 204 | 204 | $this->sourcesRepository |
@@ -219,8 +219,8 @@ discard block |
||
| 219 | 219 | |
| 220 | 220 | $check = new Process( |
| 221 | 221 | [ |
| 222 | - __DIR__ . '/../../../bin/roave-backward-compatibility-check', |
|
| 223 | - '--to=' . $this->versions[2], |
|
| 222 | + __DIR__.'/../../../bin/roave-backward-compatibility-check', |
|
| 223 | + '--to='.$this->versions[2], |
|
| 224 | 224 | ], |
| 225 | 225 | $this->sourcesRepository |
| 226 | 226 | ); |
@@ -248,8 +248,8 @@ discard block |
||
| 248 | 248 | |
| 249 | 249 | $check = new Process( |
| 250 | 250 | [ |
| 251 | - __DIR__ . '/../../../bin/roave-backward-compatibility-check', |
|
| 252 | - '--to=' . $this->versions[2], |
|
| 251 | + __DIR__.'/../../../bin/roave-backward-compatibility-check', |
|
| 252 | + '--to='.$this->versions[2], |
|
| 253 | 253 | ], |
| 254 | 254 | $this->sourcesRepository |
| 255 | 255 | ); |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | 'tag', |
| 288 | 288 | $tagName, |
| 289 | 289 | '-m', |
| 290 | - 'A tag for version ' . $version, |
|
| 290 | + 'A tag for version '.$version, |
|
| 291 | 291 | ], |
| 292 | 292 | $this->sourcesRepository |
| 293 | 293 | ))->mustRun(); |