@@ -18,7 +18,7 @@ |
||
| 18 | 18 | public static function fromPath(string $path) : self |
| 19 | 19 | { |
| 20 | 20 | Assert::that($path)->directory(); |
| 21 | - Assert::that($path . '/.git')->directory(); |
|
| 21 | + Assert::that($path.'/.git')->directory(); |
|
| 22 | 22 | $instance = new self(); |
| 23 | 23 | $instance->path = $path; |
| 24 | 24 | return $instance; |
@@ -76,9 +76,9 @@ discard block |
||
| 76 | 76 | $classMap = $classMapProperty->getDefaultValue(); |
| 77 | 77 | |
| 78 | 78 | Assert::that($classMap) |
| 79 | - ->isArray() |
|
| 80 | - ->all() |
|
| 81 | - ->file(); |
|
| 79 | + ->isArray() |
|
| 80 | + ->all() |
|
| 81 | + ->file(); |
|
| 82 | 82 | |
| 83 | 83 | return new StaticClassMapSourceLocator($classMap, $this->astLocator); |
| 84 | 84 | } |
@@ -92,9 +92,9 @@ discard block |
||
| 92 | 92 | $filesMap = $filesMapProperty->getDefaultValue(); |
| 93 | 93 | |
| 94 | 94 | Assert::that($filesMap) |
| 95 | - ->isArray() |
|
| 96 | - ->all() |
|
| 97 | - ->file(); |
|
| 95 | + ->isArray() |
|
| 96 | + ->all() |
|
| 97 | + ->file(); |
|
| 98 | 98 | |
| 99 | 99 | return new AggregateSourceLocator(array_values(array_map( |
| 100 | 100 | function (string $path) : SourceLocator { |
@@ -40,13 +40,13 @@ discard block |
||
| 40 | 40 | public function __invoke(string $installationPath) : SourceLocator |
| 41 | 41 | { |
| 42 | 42 | Assert::that($installationPath)->directory(); |
| 43 | - Assert::that($installationPath . '/composer.json')->file(); |
|
| 43 | + Assert::that($installationPath.'/composer.json')->file(); |
|
| 44 | 44 | |
| 45 | - $this->runInDirectory(function () { |
|
| 45 | + $this->runInDirectory(function() { |
|
| 46 | 46 | $this->installer->run(); |
| 47 | 47 | }, $installationPath); |
| 48 | 48 | |
| 49 | - $autoloadStatic = $installationPath . '/vendor/composer/autoload_static.php'; |
|
| 49 | + $autoloadStatic = $installationPath.'/vendor/composer/autoload_static.php'; |
|
| 50 | 50 | |
| 51 | 51 | Assert::that($autoloadStatic)->file(); |
| 52 | 52 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | ->file(); |
| 98 | 98 | |
| 99 | 99 | return new AggregateSourceLocator(array_values(array_map( |
| 100 | - function (string $path) : SourceLocator { |
|
| 100 | + function(string $path) : SourceLocator { |
|
| 101 | 101 | return new SingleFileSourceLocator( |
| 102 | 102 | realpath($path), |
| 103 | 103 | $this->astLocator |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | ) : Changes { |
| 32 | 32 | $changelog = Changes::new(); |
| 33 | 33 | |
| 34 | - $definedApiClassNames = array_map(function (ReflectionClass $class) : string { |
|
| 34 | + $definedApiClassNames = array_map(function(ReflectionClass $class) : string { |
|
| 35 | 35 | return $class->getName(); |
| 36 | 36 | }, $definedApi->getAllClasses()); |
| 37 | 37 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | $changelog->mergeWith($this->classBasedComparisons->compare($oldClass, $newClass)); |
| 58 | 58 | |
| 59 | - if ($newClass->isFinal() && ! $oldClass->isFinal()) { |
|
| 59 | + if ($newClass->isFinal() && !$oldClass->isFinal()) { |
|
| 60 | 60 | $changelog = $changelog->withAddedChange( |
| 61 | 61 | Change::changed(sprintf('Class %s is now final', $oldClass->getName()), true) |
| 62 | 62 | ); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | ReflectionMethod $newMethod |
| 118 | 118 | ) : Changes { |
| 119 | 119 | $newParameters = $newMethod->getParameters(); |
| 120 | - if (! array_key_exists($parameterPosition, $newParameters)) { |
|
| 120 | + if (!array_key_exists($parameterPosition, $newParameters)) { |
|
| 121 | 121 | return $changelog->withAddedChange( |
| 122 | 122 | Change::removed( |
| 123 | 123 | sprintf( |
@@ -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_map(function (string $constantName) use ($fromClass) : Change { |
|
| 31 | + return Changes::fromArray(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 | } |
@@ -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 | } |
@@ -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 ( |
|
| 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 | } |
@@ -37,19 +37,19 @@ discard block |
||
| 37 | 37 | array_combine( |
| 38 | 38 | $sharedKeys, |
| 39 | 39 | array_map( |
| 40 | - function (string $propertyName) use ($visibilitiesFrom, $visibilitiesTo) : array { |
|
| 40 | + function(string $propertyName) use ($visibilitiesFrom, $visibilitiesTo) : array { |
|
| 41 | 41 | return [$visibilitiesFrom[$propertyName], $visibilitiesTo[$propertyName]]; |
| 42 | 42 | }, |
| 43 | 43 | $sharedKeys |
| 44 | 44 | ) |
| 45 | 45 | ), |
| 46 | - function (array $visibilities) : bool { |
|
| 46 | + function(array $visibilities) : bool { |
|
| 47 | 47 | // Note: works because the strings "public", "protected" and "private" can be compared directly as they sort correctly for our purposes |
| 48 | 48 | return $visibilities[0] > $visibilities[1]; |
| 49 | 49 | } |
| 50 | 50 | ); |
| 51 | 51 | |
| 52 | - return Changes::fromArray(array_values(array_map(function ( |
|
| 52 | + return Changes::fromArray(array_values(array_map(function( |
|
| 53 | 53 | string $methodName, |
| 54 | 54 | array $visibilities |
| 55 | 55 | ) use ( |
@@ -74,10 +74,10 @@ discard block |
||
| 74 | 74 | $methods = $class->getMethods(); |
| 75 | 75 | |
| 76 | 76 | return array_combine( |
| 77 | - array_map(function (ReflectionMethod $method) : string { |
|
| 77 | + array_map(function(ReflectionMethod $method) : string { |
|
| 78 | 78 | return $method->getName(); |
| 79 | 79 | }, $methods), |
| 80 | - array_map(function (ReflectionMethod $method) : string { |
|
| 80 | + array_map(function(ReflectionMethod $method) : string { |
|
| 81 | 81 | if ($method->isPublic()) { |
| 82 | 82 | return self::VISIBILITY_PUBLIC; |
| 83 | 83 | } |
@@ -37,19 +37,19 @@ discard block |
||
| 37 | 37 | array_combine( |
| 38 | 38 | $sharedKeys, |
| 39 | 39 | array_map( |
| 40 | - function (string $propertyName) use ($visibilitiesFrom, $visibilitiesTo) : array { |
|
| 40 | + function(string $propertyName) use ($visibilitiesFrom, $visibilitiesTo) : array { |
|
| 41 | 41 | return [$visibilitiesFrom[$propertyName], $visibilitiesTo[$propertyName]]; |
| 42 | 42 | }, |
| 43 | 43 | $sharedKeys |
| 44 | 44 | ) |
| 45 | 45 | ), |
| 46 | - function (array $visibilities) : bool { |
|
| 46 | + function(array $visibilities) : bool { |
|
| 47 | 47 | // Note: works because the strings "public", "protected" and "private" can be compared directly as they sort correctly for our purposes |
| 48 | 48 | return $visibilities[0] > $visibilities[1]; |
| 49 | 49 | } |
| 50 | 50 | ); |
| 51 | 51 | |
| 52 | - return Changes::fromArray(array_values(array_map(function ( |
|
| 52 | + return Changes::fromArray(array_values(array_map(function( |
|
| 53 | 53 | string $propertyName, |
| 54 | 54 | array $visibilities |
| 55 | 55 | ) use ( |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | /** @return string[] */ |
| 72 | 72 | private function propertyVisibilities(ReflectionClass $class) : array |
| 73 | 73 | { |
| 74 | - return array_map(function (ReflectionProperty $property) : string { |
|
| 74 | + return array_map(function(ReflectionProperty $property) : string { |
|
| 75 | 75 | if ($property->isPublic()) { |
| 76 | 76 | return self::VISIBILITY_PUBLIC; |
| 77 | 77 | } |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | { |
| 23 | 23 | return array_reduce( |
| 24 | 24 | $this->checks, |
| 25 | - function (Changes $changes, ClassBased $check) use ($fromClass, $toClass) : Changes { |
|
| 25 | + function(Changes $changes, ClassBased $check) use ($fromClass, $toClass) : Changes { |
|
| 26 | 26 | return $changes->mergeWith($check->compare($fromClass, $toClass)); |
| 27 | 27 | }, |
| 28 | 28 | Changes::new() |