@@ -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\Command; |
6 | 6 | |
@@ -111,15 +111,15 @@ discard block |
||
111 | 111 | $toPath = $this->git->checkout($sourceRepo, $toRevision); |
112 | 112 | |
113 | 113 | try { |
114 | - $fromSources = $fromPath . '/' . $sourcesPath; |
|
115 | - $toSources = $toPath . '/' . $sourcesPath; |
|
114 | + $fromSources = $fromPath.'/'.$sourcesPath; |
|
115 | + $toSources = $toPath.'/'.$sourcesPath; |
|
116 | 116 | |
117 | 117 | Assert::that($fromSources)->directory(); |
118 | 118 | Assert::that($toSources)->directory(); |
119 | 119 | |
120 | 120 | $changes = $this->comparator->compare( |
121 | - $this->reflectorFactory->__invoke((string) $fromPath . '/' . $sourcesPath), |
|
122 | - $this->reflectorFactory->__invoke((string) $toPath . '/' . $sourcesPath) |
|
121 | + $this->reflectorFactory->__invoke((string) $fromPath.'/'.$sourcesPath), |
|
122 | + $this->reflectorFactory->__invoke((string) $toPath.'/'.$sourcesPath) |
|
123 | 123 | ); |
124 | 124 | |
125 | 125 | (new SymfonyConsoleTextFormatter($output))->write($changes); |
@@ -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; |
6 | 6 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | return $changelog; |
49 | 49 | } |
50 | 50 | |
51 | - if ($newClass->isFinal() && ! $oldClass->isFinal()) { |
|
51 | + if ($newClass->isFinal() && !$oldClass->isFinal()) { |
|
52 | 52 | $changelog = $changelog->withAddedChange( |
53 | 53 | Change::changed(sprintf('Class %s is now final', $oldClass->getName()), true) |
54 | 54 | ); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | ReflectionMethod $newMethod |
110 | 110 | ) : Changes { |
111 | 111 | $newParameters = $newMethod->getParameters(); |
112 | - if (! array_key_exists($parameterPosition, $newParameters)) { |
|
112 | + if (!array_key_exists($parameterPosition, $newParameters)) { |
|
113 | 113 | return $changelog->withAddedChange( |
114 | 114 | Change::removed( |
115 | 115 | sprintf( |
@@ -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\Git; |
6 | 6 | |
@@ -18,7 +18,7 @@ discard block |
||
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; |
@@ -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\Git; |
6 | 6 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | // @todo handle invalid versions more gracefully (drop them) |
32 | 32 | return VersionsCollection::fromArray(array_filter( |
33 | 33 | explode("\n", $output), |
34 | - function (string $maybeVersion) { |
|
34 | + function(string $maybeVersion) { |
|
35 | 35 | return trim($maybeVersion) !== ''; |
36 | 36 | } |
37 | 37 | )); |
@@ -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\Git; |
6 | 6 | |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | */ |
17 | 17 | public function checkout(CheckedOutRepository $sourceRepository, Revision $revision) : CheckedOutRepository |
18 | 18 | { |
19 | - $checkoutDirectory = sys_get_temp_dir() . '/api-compare-' . (string) $revision; |
|
19 | + $checkoutDirectory = sys_get_temp_dir().'/api-compare-'.(string) $revision; |
|
20 | 20 | |
21 | 21 | (new Process(['git', 'clone', (string) $sourceRepository, $checkoutDirectory]))->mustRun(); |
22 | 22 | (new Process(['git', 'checkout', (string) $revision]))->setWorkingDirectory($checkoutDirectory)->mustRun(); |
@@ -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 | |
@@ -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 public, protected and private are (luckily) sortable |
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 | } |
@@ -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 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | array_change_key_case($this->accessibleMethods($toClass), CASE_UPPER) |
30 | 30 | ); |
31 | 31 | |
32 | - return Changes::fromArray(array_values(array_map(function (ReflectionMethod $method) use ($fromClass) : Change { |
|
32 | + return Changes::fromArray(array_values(array_map(function(ReflectionMethod $method) use ($fromClass) : Change { |
|
33 | 33 | return Change::removed( |
34 | 34 | sprintf('Method %s#%s() was removed', $fromClass->getName(), $method->getName()), |
35 | 35 | true |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | /** @return ReflectionMethod[] */ |
41 | 41 | private function accessibleMethods(ReflectionClass $class) : array |
42 | 42 | { |
43 | - $methods = array_filter($class->getMethods(), function (ReflectionMethod $method) : bool { |
|
43 | + $methods = array_filter($class->getMethods(), function(ReflectionMethod $method) : bool { |
|
44 | 44 | return $method->isPublic() || $method->isProtected(); |
45 | 45 | }); |
46 | 46 | |
47 | 47 | return array_combine( |
48 | - array_map(function (ReflectionMethod $method) : string { |
|
48 | + array_map(function(ReflectionMethod $method) : string { |
|
49 | 49 | return $method->getName(); |
50 | 50 | }, $methods), |
51 | 51 | $methods |
@@ -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 | |
@@ -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 public, protected and private are (luckily) sortable |
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 | } |
@@ -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\ApiCompareCli; |
6 | 6 | |
@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | use Symfony\Component\Console\Application; |
16 | 16 | use function file_exists; |
17 | 17 | |
18 | -(function () : void { |
|
19 | - foreach ([__DIR__ . '/../vendor/autoload.php', __DIR__ . '/../autoload.php'] as $autoload) { |
|
20 | - if (! file_exists($autoload)) { |
|
18 | +(function() : void { |
|
19 | + foreach ([__DIR__.'/../vendor/autoload.php', __DIR__.'/../autoload.php'] as $autoload) { |
|
20 | + if (!file_exists($autoload)) { |
|
21 | 21 | continue; |
22 | 22 | } |
23 | 23 |