@@ -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 | |
@@ -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,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Roave\ApiCompare\Formatter; |
| 5 | 5 | |
@@ -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 | |
@@ -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 RoaveTest\ApiCompare\Git; |
| 6 | 6 | |
@@ -18,14 +18,14 @@ discard block |
||
| 18 | 18 | { |
| 19 | 19 | public function testFromPath() : void |
| 20 | 20 | { |
| 21 | - $path = sys_get_temp_dir() . '/' . uniqid('testPath', true); |
|
| 21 | + $path = sys_get_temp_dir().'/'.uniqid('testPath', true); |
|
| 22 | 22 | mkdir($path, 0777, true); |
| 23 | - mkdir($path . '/.git'); |
|
| 23 | + mkdir($path.'/.git'); |
|
| 24 | 24 | |
| 25 | 25 | $checkedOutRepository = CheckedOutRepository::fromPath($path); |
| 26 | 26 | self::assertSame($path, (string) $checkedOutRepository); |
| 27 | 27 | |
| 28 | - rmdir($path . '/.git'); |
|
| 28 | + rmdir($path.'/.git'); |
|
| 29 | 29 | rmdir($path); |
| 30 | 30 | } |
| 31 | 31 | } |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace RoaveTest\ApiCompare\Git; |
| 5 | 5 | |
@@ -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 RoaveTest\ApiCompare\Git; |
| 6 | 6 | |
@@ -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); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | self::assertSame( |
| 53 | 53 | ['1.0.0'], |
| 54 | 54 | array_map( |
| 55 | - function (Version $version) { |
|
| 55 | + function(Version $version) { |
|
| 56 | 56 | return $version->getVersionString(); |
| 57 | 57 | }, |
| 58 | 58 | iterator_to_array((new GetVersionCollectionFromGitRepository())->fromRepository($this->repoPath)) |
@@ -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\Variance; |
| 6 | 6 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | return false; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - if ($type->allowsNull() && ! $comparedType->allowsNull()) { |
|
| 35 | + if ($type->allowsNull() && !$comparedType->allowsNull()) { |
|
| 36 | 36 | return false; |
| 37 | 37 | } |
| 38 | 38 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | return true; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - if (strtolower($comparedTypeAsString) === 'object' && ! $type->isBuiltin()) { |
|
| 51 | + if (strtolower($comparedTypeAsString) === 'object' && !$type->isBuiltin()) { |
|
| 52 | 52 | // `object` is always contravariant to any object type |
| 53 | 53 | return true; |
| 54 | 54 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace RoaveTest\ApiCompare\Formatter; |
| 5 | 5 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | $output->expects(self::any()) |
| 37 | 37 | ->method('writeln') |
| 38 | - ->willReturnCallback(function (string $output) use ($changeToExpect) { |
|
| 38 | + ->willReturnCallback(function(string $output) use ($changeToExpect) { |
|
| 39 | 39 | self::assertContains($changeToExpect, $output); |
| 40 | 40 | }); |
| 41 | 41 | |