@@ -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 |
@@ -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( |
@@ -29,7 +29,7 @@ |
||
29 | 29 | { |
30 | 30 | $reflector = new ClassReflector( |
31 | 31 | $this->locateSources |
32 | - ->__invoke(__DIR__ . '/../../asset/located-sources/composer-definition-with-everything') |
|
32 | + ->__invoke(__DIR__.'/../../asset/located-sources/composer-definition-with-everything') |
|
33 | 33 | ); |
34 | 34 | |
35 | 35 | self::assertSame( |
@@ -139,7 +139,7 @@ |
||
139 | 139 | (new Process(['git', 'add', '-A'], $this->sourcesRepository))->mustRun(); |
140 | 140 | (new Process(['git', 'commit', '-am', sprintf('Class sources v%d', $key + 1)], $this->sourcesRepository))->mustRun(); |
141 | 141 | $this->versions[$key] = trim((new Process(['git', 'rev-parse', 'HEAD'], $this->sourcesRepository))->mustRun() |
142 | - ->getOutput()); |
|
142 | + ->getOutput()); |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 |
@@ -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(['git', 'commit', '-am', sprintf('Class sources v%d', $key + 1)], $this->sourcesRepository))->mustRun(); |
@@ -158,9 +158,9 @@ discard block |
||
158 | 158 | { |
159 | 159 | $check = new Process( |
160 | 160 | [ |
161 | - __DIR__ . '/../../../bin/roave-backward-compatibility-check', |
|
162 | - '--from=' . $this->versions[0], |
|
163 | - '--to=' . $this->versions[1], |
|
161 | + __DIR__.'/../../../bin/roave-backward-compatibility-check', |
|
162 | + '--from='.$this->versions[0], |
|
163 | + '--to='.$this->versions[1], |
|
164 | 164 | ], |
165 | 165 | $this->sourcesRepository |
166 | 166 | ); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | public function testWillNotRunWithoutTagsNorSpecifiedVersions() : void |
181 | 181 | { |
182 | 182 | $check = new Process( |
183 | - [__DIR__ . '/../../../bin/roave-backward-compatibility-check'], |
|
183 | + [__DIR__.'/../../../bin/roave-backward-compatibility-check'], |
|
184 | 184 | $this->sourcesRepository |
185 | 185 | ); |
186 | 186 | |
@@ -195,9 +195,9 @@ discard block |
||
195 | 195 | { |
196 | 196 | $check = new Process( |
197 | 197 | [ |
198 | - __DIR__ . '/../../../bin/roave-backward-compatibility-check', |
|
199 | - '--from=' . $this->versions[0], |
|
200 | - '--to=' . $this->versions[3], |
|
198 | + __DIR__.'/../../../bin/roave-backward-compatibility-check', |
|
199 | + '--from='.$this->versions[0], |
|
200 | + '--to='.$this->versions[3], |
|
201 | 201 | '-vvv', |
202 | 202 | ], |
203 | 203 | $this->sourcesRepository |
@@ -216,8 +216,8 @@ discard block |
||
216 | 216 | |
217 | 217 | $check = new Process( |
218 | 218 | [ |
219 | - __DIR__ . '/../../../bin/roave-backward-compatibility-check', |
|
220 | - '--to=' . $this->versions[2], |
|
219 | + __DIR__.'/../../../bin/roave-backward-compatibility-check', |
|
220 | + '--to='.$this->versions[2], |
|
221 | 221 | ], |
222 | 222 | $this->sourcesRepository |
223 | 223 | ); |
@@ -245,8 +245,8 @@ discard block |
||
245 | 245 | |
246 | 246 | $check = new Process( |
247 | 247 | [ |
248 | - __DIR__ . '/../../../bin/roave-backward-compatibility-check', |
|
249 | - '--to=' . $this->versions[2], |
|
248 | + __DIR__.'/../../../bin/roave-backward-compatibility-check', |
|
249 | + '--to='.$this->versions[2], |
|
250 | 250 | ], |
251 | 251 | $this->sourcesRepository |
252 | 252 | ); |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | 'tag', |
285 | 285 | $tagName, |
286 | 286 | '-m', |
287 | - 'A tag for version ' . $version, |
|
287 | + 'A tag for version '.$version, |
|
288 | 288 | ], |
289 | 289 | $this->sourcesRepository |
290 | 290 | ))->mustRun(); |
@@ -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 | - static function (Version $version) : string { |
|
52 | + static function(Version $version) : string { |
|
53 | 53 | return $version->getVersionString(); |
54 | 54 | }, |
55 | 55 | iterator_to_array((new GetVersionCollectionFromGitRepository())->fromRepository($this->repoPath)) |
@@ -19,14 +19,14 @@ discard block |
||
19 | 19 | { |
20 | 20 | public function testFromPath() : void |
21 | 21 | { |
22 | - $path = sys_get_temp_dir() . '/' . uniqid('testPath', true); |
|
22 | + $path = sys_get_temp_dir().'/'.uniqid('testPath', true); |
|
23 | 23 | mkdir($path, 0777, true); |
24 | - mkdir($path . '/.git'); |
|
24 | + mkdir($path.'/.git'); |
|
25 | 25 | |
26 | 26 | $checkedOutRepository = CheckedOutRepository::fromPath($path); |
27 | 27 | self::assertSame($path, (string) $checkedOutRepository); |
28 | 28 | |
29 | - rmdir($path . '/.git'); |
|
29 | + rmdir($path.'/.git'); |
|
30 | 30 | rmdir($path); |
31 | 31 | } |
32 | 32 | |
@@ -41,6 +41,6 @@ discard block |
||
41 | 41 | { |
42 | 42 | $this->expectException(AssertionFailedException::class); |
43 | 43 | |
44 | - CheckedOutRepository::fromPath(__DIR__ . '/non-existing'); |
|
44 | + CheckedOutRepository::fromPath(__DIR__.'/non-existing'); |
|
45 | 45 | } |
46 | 46 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | ->getOutput() |
83 | 83 | ); |
84 | 84 | |
85 | - file_put_contents($repoPath . '/a-file.txt', 'file contents'); |
|
85 | + file_put_contents($repoPath.'/a-file.txt', 'file contents'); |
|
86 | 86 | |
87 | 87 | (new Process(['git', 'add', 'a-file.txt'], $repoPath)) |
88 | 88 | ->mustRun(); |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | $first = $git->checkout($sourceRepository, $firstCommit); |
103 | 103 | $second = $git->checkout($sourceRepository, $secondCommit); |
104 | 104 | |
105 | - self::assertFileNotExists($first->__toString() . '/a-file.txt'); |
|
106 | - self::assertFileExists($second->__toString() . '/a-file.txt'); |
|
105 | + self::assertFileNotExists($first->__toString().'/a-file.txt'); |
|
106 | + self::assertFileExists($second->__toString().'/a-file.txt'); |
|
107 | 107 | |
108 | 108 | $git->remove($first); |
109 | 109 | $git->remove($second); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | public function testExceptionIsThrownWhenTwoPathsCollide() : void |
115 | 115 | { |
116 | - $git = new GitCheckoutRevisionToTemporaryPath(static function () : string { |
|
116 | + $git = new GitCheckoutRevisionToTemporaryPath(static function() : string { |
|
117 | 117 | return 'foo'; |
118 | 118 | }); |
119 | 119 | $sourceRepository = $this->sourceRepository(); |
@@ -141,6 +141,6 @@ discard block |
||
141 | 141 | |
142 | 142 | private function sourceRepository() : CheckedOutRepository |
143 | 143 | { |
144 | - return CheckedOutRepository::fromPath(realpath(__DIR__ . '/../../..')); |
|
144 | + return CheckedOutRepository::fromPath(realpath(__DIR__.'/../../..')); |
|
145 | 145 | } |
146 | 146 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | |
37 | 37 | $output->expects(self::once()) |
38 | 38 | ->method('writeln') |
39 | - ->willReturnCallback(static function (string $output) use ($changeToExpect) : void { |
|
39 | + ->willReturnCallback(static function(string $output) use ($changeToExpect) : void { |
|
40 | 40 | self::assertStringContainsString($changeToExpect, $output); |
41 | 41 | }); |
42 | 42 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $this->originalCwd = getcwd(); |
48 | 48 | $this->composerInstaller = $this->createMock(Installer::class); |
49 | 49 | $this->astLocator = (new BetterReflection())->astLocator(); |
50 | - $this->makeInstaller = function (string $installationPath) : Installer { |
|
50 | + $this->makeInstaller = function(string $installationPath) : Installer { |
|
51 | 51 | self::assertSame($this->expectedInstallatonPath, $installationPath); |
52 | 52 | |
53 | 53 | return $this->composerInstaller; |
@@ -74,12 +74,12 @@ discard block |
||
74 | 74 | |
75 | 75 | $this |
76 | 76 | ->locateDependencies |
77 | - ->__invoke(__DIR__ . '/non-existing'); |
|
77 | + ->__invoke(__DIR__.'/non-existing'); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | public function testWillLocateDependencies() : void |
81 | 81 | { |
82 | - $this->expectedInstallatonPath = realpath(__DIR__ . '/../../asset/composer-installation-structure'); |
|
82 | + $this->expectedInstallatonPath = realpath(__DIR__.'/../../asset/composer-installation-structure'); |
|
83 | 83 | |
84 | 84 | $this |
85 | 85 | ->composerInstaller |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | ->composerInstaller |
107 | 107 | ->expects(self::once()) |
108 | 108 | ->method('run') |
109 | - ->willReturnCallback(function () : void { |
|
109 | + ->willReturnCallback(function() : void { |
|
110 | 110 | self::assertSame($this->expectedInstallatonPath, getcwd()); |
111 | 111 | }); |
112 | 112 |