@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | { |
19 | 19 | $changeText = uniqid('changeText', true); |
20 | 20 | $change = Change::added($changeText, false); |
21 | - self::assertSame(' ADDED: ' . $changeText, (string) $change); |
|
21 | + self::assertSame(' ADDED: '.$changeText, (string) $change); |
|
22 | 22 | self::assertTrue($change->isAdded()); |
23 | 23 | self::assertFalse($change->isChanged()); |
24 | 24 | self::assertFalse($change->isRemoved()); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | { |
30 | 30 | $changeText = uniqid('changeText', true); |
31 | 31 | $change = Change::added($changeText, true); |
32 | - self::assertSame('[BC] ADDED: ' . $changeText, (string) $change); |
|
32 | + self::assertSame('[BC] ADDED: '.$changeText, (string) $change); |
|
33 | 33 | self::assertTrue($change->isAdded()); |
34 | 34 | self::assertFalse($change->isChanged()); |
35 | 35 | self::assertFalse($change->isRemoved()); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | { |
41 | 41 | $changeText = uniqid('changeText', true); |
42 | 42 | $change = Change::changed($changeText, false); |
43 | - self::assertSame(' CHANGED: ' . $changeText, (string) $change); |
|
43 | + self::assertSame(' CHANGED: '.$changeText, (string) $change); |
|
44 | 44 | self::assertFalse($change->isAdded()); |
45 | 45 | self::assertTrue($change->isChanged()); |
46 | 46 | self::assertFalse($change->isRemoved()); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | { |
51 | 51 | $changeText = uniqid('changeText', true); |
52 | 52 | $change = Change::changed($changeText, true); |
53 | - self::assertSame('[BC] CHANGED: ' . $changeText, (string) $change); |
|
53 | + self::assertSame('[BC] CHANGED: '.$changeText, (string) $change); |
|
54 | 54 | self::assertFalse($change->isAdded()); |
55 | 55 | self::assertTrue($change->isChanged()); |
56 | 56 | self::assertFalse($change->isRemoved()); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | { |
62 | 62 | $changeText = uniqid('changeText', true); |
63 | 63 | $change = Change::removed($changeText, false); |
64 | - self::assertSame(' REMOVED: ' . $changeText, (string) $change); |
|
64 | + self::assertSame(' REMOVED: '.$changeText, (string) $change); |
|
65 | 65 | self::assertFalse($change->isAdded()); |
66 | 66 | self::assertFalse($change->isChanged()); |
67 | 67 | self::assertTrue($change->isRemoved()); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | { |
73 | 73 | $changeText = uniqid('changeText', true); |
74 | 74 | $change = Change::removed($changeText, true); |
75 | - self::assertSame('[BC] REMOVED: ' . $changeText, (string) $change); |
|
75 | + self::assertSame('[BC] REMOVED: '.$changeText, (string) $change); |
|
76 | 76 | self::assertFalse($change->isAdded()); |
77 | 77 | self::assertFalse($change->isChanged()); |
78 | 78 | self::assertTrue($change->isRemoved()); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | { |
84 | 84 | $failure = new Exception('changeText'); |
85 | 85 | $change = Change::skippedDueToFailure($failure); |
86 | - self::assertSame('[BC] SKIPPED: ' . $failure->getMessage(), (string) $change); |
|
86 | + self::assertSame('[BC] SKIPPED: '.$failure->getMessage(), (string) $change); |
|
87 | 87 | self::assertFalse($change->isAdded()); |
88 | 88 | self::assertFalse($change->isChanged()); |
89 | 89 | self::assertFalse($change->isRemoved()); |
@@ -31,11 +31,11 @@ discard block |
||
31 | 31 | use Symfony\Component\Console\Output\ConsoleOutput; |
32 | 32 | use function file_exists; |
33 | 33 | |
34 | -(function () : void { |
|
35 | - (function () : void { |
|
34 | +(function() : void { |
|
35 | + (function() : void { |
|
36 | 36 | $autoloaderLocations = [ |
37 | - __DIR__ . '/../vendor/autoload.php', // Installed by cloning the project and running `composer install` |
|
38 | - __DIR__ . '/../../../autoload.php', // Installed via `composer require` |
|
37 | + __DIR__.'/../vendor/autoload.php', // Installed by cloning the project and running `composer install` |
|
38 | + __DIR__.'/../../../autoload.php', // Installed via `composer require` |
|
39 | 39 | ]; |
40 | 40 | |
41 | 41 | foreach ($autoloaderLocations as $autoload) { |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | new GetVersionCollectionFromGitRepository(), |
65 | 65 | new PickLastMinorVersionFromCollection(), |
66 | 66 | new LocateDependenciesViaComposer( |
67 | - function (string $installationPath) use ($composerIo) : Installer { |
|
67 | + function(string $installationPath) use ($composerIo) : Installer { |
|
68 | 68 | return Installer::create( |
69 | 69 | $composerIo, |
70 | 70 | (new Factory())->createComposer( |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | public function setUp() : void |
77 | 77 | { |
78 | - $repositoryPath = realpath(__DIR__ . '/../../../'); |
|
78 | + $repositoryPath = realpath(__DIR__.'/../../../'); |
|
79 | 79 | |
80 | 80 | self::assertInternalType('string', $repositoryPath); |
81 | 81 | |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | |
275 | 275 | $this->output->expects(self::any()) |
276 | 276 | ->method('writeln') |
277 | - ->willReturnCallback(function (string $output) use ($changeToExpect) : void { |
|
277 | + ->willReturnCallback(function(string $output) use ($changeToExpect) : void { |
|
278 | 278 | self::assertContains($changeToExpect, $output); |
279 | 279 | }); |
280 | 280 | } |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | |
359 | 359 | $this->getVersions->expects(self::once()) |
360 | 360 | ->method('fromRepository') |
361 | - ->with(self::callback(function (CheckedOutRepository $checkedOutRepository) : bool { |
|
361 | + ->with(self::callback(function(CheckedOutRepository $checkedOutRepository) : bool { |
|
362 | 362 | self::assertEquals($this->sourceRepository, $checkedOutRepository); |
363 | 363 | return true; |
364 | 364 | })) |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | public function testExceptionIsThrownWhenTwoPathsCollide() : void |
49 | 49 | { |
50 | - $git = new GitCheckoutRevisionToTemporaryPath(function () : string { |
|
50 | + $git = new GitCheckoutRevisionToTemporaryPath(function() : string { |
|
51 | 51 | return 'foo'; |
52 | 52 | }); |
53 | 53 | $sourceRepository = $this->sourceRepository(); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | private function sourceRepository() : CheckedOutRepository |
77 | 77 | { |
78 | - $repositoryPath = realpath(__DIR__ . '/../../..'); |
|
78 | + $repositoryPath = realpath(__DIR__.'/../../..'); |
|
79 | 79 | |
80 | 80 | self::assertInternalType('string', $repositoryPath); |
81 | 81 |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $this->originalCwd = $originalCwd; |
54 | 54 | $this->composerInstaller = $this->createMock(Installer::class); |
55 | 55 | $this->astLocator = (new BetterReflection())->astLocator(); |
56 | - $this->makeInstaller = function (string $installationPath) : Installer { |
|
56 | + $this->makeInstaller = function(string $installationPath) : Installer { |
|
57 | 57 | self::assertSame($this->expectedInstallatonPath, $installationPath); |
58 | 58 | |
59 | 59 | return $this->composerInstaller; |
@@ -102,13 +102,13 @@ discard block |
||
102 | 102 | |
103 | 103 | public function testWillLocateDependencies() : void |
104 | 104 | { |
105 | - $this->expectedInstallatonPath = $this->realpath(__DIR__ . '/../../asset/composer-installation-structure'); |
|
105 | + $this->expectedInstallatonPath = $this->realpath(__DIR__.'/../../asset/composer-installation-structure'); |
|
106 | 106 | |
107 | 107 | $this |
108 | 108 | ->composerInstaller |
109 | 109 | ->expects(self::once()) |
110 | 110 | ->method('run') |
111 | - ->willReturnCallback(function () : void { |
|
111 | + ->willReturnCallback(function() : void { |
|
112 | 112 | self::assertSame($this->expectedInstallatonPath, getcwd()); |
113 | 113 | }); |
114 | 114 | |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | self::assertEquals( |
129 | 129 | new StaticClassMapSourceLocator( |
130 | 130 | [ |
131 | - 'A\\ClassName' => $this->realpath(__DIR__ . '/../../asset/composer-installation-structure/AClassName.php'), |
|
132 | - 'B\\ClassName' => $this->realpath(__DIR__ . '/../../asset/composer-installation-structure/BClassName.php'), |
|
131 | + 'A\\ClassName' => $this->realpath(__DIR__.'/../../asset/composer-installation-structure/AClassName.php'), |
|
132 | + 'B\\ClassName' => $this->realpath(__DIR__.'/../../asset/composer-installation-structure/BClassName.php'), |
|
133 | 133 | ], |
134 | 134 | $this->astLocator |
135 | 135 | ), |
@@ -138,11 +138,11 @@ discard block |
||
138 | 138 | self::assertEquals( |
139 | 139 | new AggregateSourceLocator([ |
140 | 140 | new SingleFileSourceLocator( |
141 | - $this->realpath(__DIR__ . '/../../asset/composer-installation-structure/included-file-1.php'), |
|
141 | + $this->realpath(__DIR__.'/../../asset/composer-installation-structure/included-file-1.php'), |
|
142 | 142 | $this->astLocator |
143 | 143 | ), |
144 | 144 | new SingleFileSourceLocator( |
145 | - $this->realpath(__DIR__ . '/../../asset/composer-installation-structure/included-file-2.php'), |
|
145 | + $this->realpath(__DIR__.'/../../asset/composer-installation-structure/included-file-2.php'), |
|
146 | 146 | $this->astLocator |
147 | 147 | ), |
148 | 148 | ]), |
@@ -154,13 +154,13 @@ discard block |
||
154 | 154 | |
155 | 155 | public function testWillLocateDependenciesEvenWithoutAutoloadFiles() : void |
156 | 156 | { |
157 | - $this->expectedInstallatonPath = $this->realpath(__DIR__ . '/../../asset/composer-installation-structure-without-autoload-files'); |
|
157 | + $this->expectedInstallatonPath = $this->realpath(__DIR__.'/../../asset/composer-installation-structure-without-autoload-files'); |
|
158 | 158 | |
159 | 159 | $this |
160 | 160 | ->composerInstaller |
161 | 161 | ->expects(self::once()) |
162 | 162 | ->method('run') |
163 | - ->willReturnCallback(function () : void { |
|
163 | + ->willReturnCallback(function() : void { |
|
164 | 164 | self::assertSame($this->expectedInstallatonPath, getcwd()); |
165 | 165 | }); |
166 | 166 | |
@@ -180,8 +180,8 @@ discard block |
||
180 | 180 | self::assertEquals( |
181 | 181 | new StaticClassMapSourceLocator( |
182 | 182 | [ |
183 | - 'A\\ClassName' => $this->realpath(__DIR__ . '/../../asset/composer-installation-structure-without-autoload-files/AClassName.php'), |
|
184 | - 'B\\ClassName' => $this->realpath(__DIR__ . '/../../asset/composer-installation-structure-without-autoload-files/BClassName.php'), |
|
183 | + 'A\\ClassName' => $this->realpath(__DIR__.'/../../asset/composer-installation-structure-without-autoload-files/AClassName.php'), |
|
184 | + 'B\\ClassName' => $this->realpath(__DIR__.'/../../asset/composer-installation-structure-without-autoload-files/BClassName.php'), |
|
185 | 185 | ], |
186 | 186 | $this->astLocator |
187 | 187 | ), |
@@ -45,37 +45,37 @@ |
||
45 | 45 | { |
46 | 46 | return [ |
47 | 47 | 'empty composer definition' => [ |
48 | - __DIR__ . '/../../asset/located-sources/empty', |
|
48 | + __DIR__.'/../../asset/located-sources/empty', |
|
49 | 49 | new AggregateSourceLocator([ |
50 | 50 | new DirectoriesSourceLocator([], $this->astLocator()), |
51 | 51 | ]), |
52 | 52 | ], |
53 | 53 | 'composer definition with everything' => [ |
54 | - __DIR__ . '/../../asset/located-sources/composer-definition-with-everything', |
|
54 | + __DIR__.'/../../asset/located-sources/composer-definition-with-everything', |
|
55 | 55 | new AggregateSourceLocator([ |
56 | 56 | new DirectoriesSourceLocator( |
57 | 57 | [ |
58 | - $this->realPath(__DIR__ . '/../../asset/located-sources/composer-definition-with-everything/foo0'), |
|
59 | - $this->realPath(__DIR__ . '/../../asset/located-sources/composer-definition-with-everything/bar4'), |
|
60 | - $this->realPath(__DIR__ . '/../../asset/located-sources/composer-definition-with-everything/baz4_0'), |
|
61 | - $this->realPath(__DIR__ . '/../../asset/located-sources/composer-definition-with-everything/baz4_1'), |
|
62 | - $this->realPath(__DIR__ . '/../../asset/located-sources/composer-definition-with-everything/baz4_2'), |
|
63 | - $this->realPath(__DIR__ . '/../../asset/located-sources/composer-definition-with-everything/baz4_3'), |
|
64 | - $this->realPath(__DIR__ . '/../../asset/located-sources/composer-definition-with-everything/classmap0'), |
|
65 | - $this->realPath(__DIR__ . '/../../asset/located-sources/composer-definition-with-everything/classmap1'), |
|
58 | + $this->realPath(__DIR__.'/../../asset/located-sources/composer-definition-with-everything/foo0'), |
|
59 | + $this->realPath(__DIR__.'/../../asset/located-sources/composer-definition-with-everything/bar4'), |
|
60 | + $this->realPath(__DIR__.'/../../asset/located-sources/composer-definition-with-everything/baz4_0'), |
|
61 | + $this->realPath(__DIR__.'/../../asset/located-sources/composer-definition-with-everything/baz4_1'), |
|
62 | + $this->realPath(__DIR__.'/../../asset/located-sources/composer-definition-with-everything/baz4_2'), |
|
63 | + $this->realPath(__DIR__.'/../../asset/located-sources/composer-definition-with-everything/baz4_3'), |
|
64 | + $this->realPath(__DIR__.'/../../asset/located-sources/composer-definition-with-everything/classmap0'), |
|
65 | + $this->realPath(__DIR__.'/../../asset/located-sources/composer-definition-with-everything/classmap1'), |
|
66 | 66 | ], |
67 | 67 | $this->astLocator() |
68 | 68 | ), |
69 | 69 | new SingleFileSourceLocator( |
70 | - $this->realPath(__DIR__ . '/../../asset/located-sources/composer-definition-with-everything/classmap2/file.php'), |
|
70 | + $this->realPath(__DIR__.'/../../asset/located-sources/composer-definition-with-everything/classmap2/file.php'), |
|
71 | 71 | $this->astLocator() |
72 | 72 | ), |
73 | 73 | new SingleFileSourceLocator( |
74 | - $this->realPath(__DIR__ . '/../../asset/located-sources/composer-definition-with-everything/files/foo.php'), |
|
74 | + $this->realPath(__DIR__.'/../../asset/located-sources/composer-definition-with-everything/files/foo.php'), |
|
75 | 75 | $this->astLocator() |
76 | 76 | ), |
77 | 77 | new SingleFileSourceLocator( |
78 | - $this->realPath(__DIR__ . '/../../asset/located-sources/composer-definition-with-everything/files/bar.php'), |
|
78 | + $this->realPath(__DIR__.'/../../asset/located-sources/composer-definition-with-everything/files/bar.php'), |
|
79 | 79 | $this->astLocator() |
80 | 80 | ), |
81 | 81 | ]), |
@@ -43,8 +43,8 @@ |
||
43 | 43 | $composerJsonPath = $realInstallationPath . '/composer.json'; |
44 | 44 | |
45 | 45 | Assert::that($composerJsonPath) |
46 | - ->file() |
|
47 | - ->readable(); |
|
46 | + ->file() |
|
47 | + ->readable(); |
|
48 | 48 | |
49 | 49 | $composerDefinitionString = file_get_contents($composerJsonPath); |
50 | 50 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | Assert::that($realInstallationPath)->string(); |
42 | 42 | |
43 | - $composerJsonPath = $realInstallationPath . '/composer.json'; |
|
43 | + $composerJsonPath = $realInstallationPath.'/composer.json'; |
|
44 | 44 | |
45 | 45 | Assert::that($composerJsonPath) |
46 | 46 | ->file() |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | ), |
76 | 76 | ], |
77 | 77 | array_map( |
78 | - function (string $path) : SourceLocator { |
|
78 | + function(string $path) : SourceLocator { |
|
79 | 79 | return new SingleFileSourceLocator($path, $this->astLocator); |
80 | 80 | }, |
81 | 81 | array_map( |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | ) |
85 | 85 | ), |
86 | 86 | array_map( |
87 | - function (string $path) : SourceLocator { |
|
87 | + function(string $path) : SourceLocator { |
|
88 | 88 | return new SingleFileSourceLocator($path, $this->astLocator); |
89 | 89 | }, |
90 | 90 | array_map( |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | { |
105 | 105 | return array_values(array_filter( |
106 | 106 | $autoloadDefinition['classmap'] ?? [], |
107 | - function (string $path) use ($installationPath) : bool { |
|
107 | + function(string $path) use ($installationPath) : bool { |
|
108 | 108 | $filePath = ($this->prependInstallationPath($installationPath))($path); |
109 | 109 | |
110 | 110 | return is_dir($filePath); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | { |
122 | 122 | return array_values(array_filter( |
123 | 123 | $autoloadDefinition['classmap'] ?? [], |
124 | - function (string $path) use ($installationPath) : bool { |
|
124 | + function(string $path) use ($installationPath) : bool { |
|
125 | 125 | $filePath = ($this->prependInstallationPath($installationPath))($path); |
126 | 126 | |
127 | 127 | return is_file($filePath); |
@@ -168,12 +168,12 @@ discard block |
||
168 | 168 | /** @return callable (string $path) : string */ |
169 | 169 | private function prependInstallationPath(string $installationPath) : callable |
170 | 170 | { |
171 | - return function (string $path) use ($installationPath) : string { |
|
171 | + return function(string $path) use ($installationPath) : string { |
|
172 | 172 | if (strpos($path, './') === 0) { |
173 | - return $installationPath . '/' . substr($path, 2); |
|
173 | + return $installationPath.'/'.substr($path, 2); |
|
174 | 174 | } |
175 | 175 | |
176 | - return $installationPath . '/' . ltrim($path, '/'); |
|
176 | + return $installationPath.'/'.ltrim($path, '/'); |
|
177 | 177 | }; |
178 | 178 | } |
179 | 179 |
@@ -51,7 +51,7 @@ |
||
51 | 51 | private function generateTemporaryPathFor(Revision $revision) : string |
52 | 52 | { |
53 | 53 | $uniquePathGenerator = $this->uniquenessFunction; |
54 | - $checkoutDirectory = sys_get_temp_dir() . '/api-compare-' . $uniquePathGenerator($revision . '_'); |
|
54 | + $checkoutDirectory = sys_get_temp_dir().'/api-compare-'.$uniquePathGenerator($revision.'_'); |
|
55 | 55 | |
56 | 56 | if (file_exists($checkoutDirectory)) { |
57 | 57 | throw new RuntimeException(sprintf( |
@@ -30,21 +30,21 @@ discard block |
||
30 | 30 | $this->output->writeln( |
31 | 31 | "# Added\n" |
32 | 32 | . implode('', $this->convertFilteredChangesToMarkdownBulletList( |
33 | - function (Change $change) : bool { |
|
33 | + function(Change $change) : bool { |
|
34 | 34 | return $change->isAdded(); |
35 | 35 | }, |
36 | 36 | ...$arrayOfChanges |
37 | 37 | )) |
38 | 38 | . "\n# Changed\n" |
39 | 39 | . implode('', $this->convertFilteredChangesToMarkdownBulletList( |
40 | - function (Change $change) : bool { |
|
40 | + function(Change $change) : bool { |
|
41 | 41 | return $change->isChanged(); |
42 | 42 | }, |
43 | 43 | ...$arrayOfChanges |
44 | 44 | )) |
45 | 45 | . "\n# Removed\n" |
46 | 46 | . implode('', $this->convertFilteredChangesToMarkdownBulletList( |
47 | - function (Change $change) : bool { |
|
47 | + function(Change $change) : bool { |
|
48 | 48 | return $change->isRemoved(); |
49 | 49 | }, |
50 | 50 | ...$arrayOfChanges |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | private function convertFilteredChangesToMarkdownBulletList(callable $filterFunction, Change ...$changes) : array |
57 | 57 | { |
58 | 58 | return array_map( |
59 | - function (Change $change) : string { |
|
60 | - return ' - ' . str_replace(['ADDED: ', 'CHANGED: ', 'REMOVED: '], '', trim($change->__toString())) . "\n"; |
|
59 | + function(Change $change) : string { |
|
60 | + return ' - '.str_replace(['ADDED: ', 'CHANGED: ', 'REMOVED: '], '', trim($change->__toString()))."\n"; |
|
61 | 61 | }, |
62 | 62 | array_filter($changes, $filterFunction) |
63 | 63 | ); |