@@ -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 | |
@@ -9,9 +9,9 @@ discard block |
||
| 9 | 9 | use Symfony\Component\Console\Application; |
| 10 | 10 | use function file_exists; |
| 11 | 11 | |
| 12 | -(function () { |
|
| 13 | - foreach ([__DIR__ . '/../vendor/autoload.php', __DIR__ . '/../autoload.php'] as $autoload) { |
|
| 14 | - if (! file_exists($autoload)) { |
|
| 12 | +(function() { |
|
| 13 | + foreach ([__DIR__.'/../vendor/autoload.php', __DIR__.'/../autoload.php'] as $autoload) { |
|
| 14 | + if (!file_exists($autoload)) { |
|
| 15 | 15 | continue; |
| 16 | 16 | } |
| 17 | 17 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Roave\ApiCompare\Git; |
| 5 | 5 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Roave\ApiCompare\Git; |
| 5 | 5 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Roave\ApiCompare\Git; |
| 5 | 5 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Roave\ApiCompare\Git; |
| 5 | 5 | |
@@ -17,14 +17,14 @@ discard block |
||
| 17 | 17 | public function fromRepository(CheckedOutRepository $checkedOutRepository) : VersionsCollection |
| 18 | 18 | { |
| 19 | 19 | $output = (new Process(['git', 'tag', '-l'])) |
| 20 | - ->setWorkingDirectory((string)$checkedOutRepository) |
|
| 20 | + ->setWorkingDirectory((string) $checkedOutRepository) |
|
| 21 | 21 | ->mustRun() |
| 22 | 22 | ->getOutput(); |
| 23 | 23 | |
| 24 | 24 | // @todo handle invalid versions more gracefully (drop them) |
| 25 | 25 | return VersionsCollection::fromArray(array_filter( |
| 26 | 26 | explode("\n", $output), |
| 27 | - function (string $maybeVersion) { |
|
| 27 | + function(string $maybeVersion) { |
|
| 28 | 28 | return trim($maybeVersion) !== ''; |
| 29 | 29 | } |
| 30 | 30 | )); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Roave\ApiCompare\Git; |
| 5 | 5 | |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | { |
| 16 | 16 | return Revision::fromSha1( |
| 17 | 17 | (new Process(['git', 'rev-parse', $something])) |
| 18 | - ->setWorkingDirectory((string)$repository) |
|
| 18 | + ->setWorkingDirectory((string) $repository) |
|
| 19 | 19 | ->mustRun() |
| 20 | 20 | ->getOutput() |
| 21 | 21 | ); |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Roave\ApiCompare\Git; |
| 5 | 5 | |
@@ -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\Command; |
| 5 | 5 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | public function setUp() : void |
| 52 | 52 | { |
| 53 | - $this->sourceRepository = CheckedOutRepository::fromPath(realpath(__DIR__ . '/../../../')); |
|
| 53 | + $this->sourceRepository = CheckedOutRepository::fromPath(realpath(__DIR__.'/../../../')); |
|
| 54 | 54 | $this->input = $this->createMock(InputInterface::class); |
| 55 | 55 | $this->output = $this->createMock(OutputInterface::class); |
| 56 | 56 | $this->performCheckout = $this->createMock(PerformCheckoutOfRevision::class); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | ->with($toSha) |
| 105 | 105 | ->willReturn(Revision::fromSha1($toSha)); |
| 106 | 106 | |
| 107 | - chdir((string)$this->sourceRepository); |
|
| 107 | + chdir((string) $this->sourceRepository); |
|
| 108 | 108 | |
| 109 | 109 | $this->compare->execute($this->input, $this->output); |
| 110 | 110 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | $this->parseRevision->expects(self::at(0)) |
| 144 | 144 | ->method('fromStringForRepository') |
| 145 | - ->with((string)$pickedVersion) |
|
| 145 | + ->with((string) $pickedVersion) |
|
| 146 | 146 | ->willReturn(Revision::fromSha1($fromSha)); |
| 147 | 147 | $this->parseRevision->expects(self::at(1)) |
| 148 | 148 | ->method('fromStringForRepository') |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | $this->getVersions->expects(self::once()) |
| 153 | 153 | ->method('fromRepository') |
| 154 | - ->with(self::callback(function (CheckedOutRepository $checkedOutRepository) : bool { |
|
| 154 | + ->with(self::callback(function(CheckedOutRepository $checkedOutRepository) : bool { |
|
| 155 | 155 | self::assertEquals($this->sourceRepository, $checkedOutRepository); |
| 156 | 156 | return true; |
| 157 | 157 | })) |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | ->with($versions) |
| 162 | 162 | ->willReturn($pickedVersion); |
| 163 | 163 | |
| 164 | - chdir((string)$this->sourceRepository); |
|
| 164 | + chdir((string) $this->sourceRepository); |
|
| 165 | 165 | |
| 166 | 166 | $this->compare->execute($this->input, $this->output); |
| 167 | 167 | } |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | ->with($toSha) |
| 205 | 205 | ->willReturn(Revision::fromSha1($toSha)); |
| 206 | 206 | |
| 207 | - chdir((string)$this->sourceRepository); |
|
| 207 | + chdir((string) $this->sourceRepository); |
|
| 208 | 208 | |
| 209 | 209 | $this->expectException(InvalidArgumentException::class); |
| 210 | 210 | $this->compare->execute($this->input, $this->output); |
@@ -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\Git; |
| 5 | 5 | |
@@ -19,10 +19,10 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | public function setUp() : void |
| 21 | 21 | { |
| 22 | - $tmpGitRepo = sys_get_temp_dir() . '/api-compare-' . uniqid('tmpGitRepo', true); |
|
| 22 | + $tmpGitRepo = sys_get_temp_dir().'/api-compare-'.uniqid('tmpGitRepo', true); |
|
| 23 | 23 | mkdir($tmpGitRepo, 0777, true); |
| 24 | 24 | (new Process(['git', 'init']))->setWorkingDirectory($tmpGitRepo)->mustRun(); |
| 25 | - file_put_contents($tmpGitRepo . '/test', uniqid('testContent', true)); |
|
| 25 | + file_put_contents($tmpGitRepo.'/test', uniqid('testContent', true)); |
|
| 26 | 26 | (new Process(['git', 'add', '.']))->setWorkingDirectory($tmpGitRepo)->mustRun(); |
| 27 | 27 | (new Process(['git', 'commit', '-m', '"whatever"']))->setWorkingDirectory($tmpGitRepo)->mustRun(); |
| 28 | 28 | $this->repoPath = CheckedOutRepository::fromPath($tmpGitRepo); |
@@ -30,12 +30,12 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | public function tearDown() : void |
| 32 | 32 | { |
| 33 | - (new Process(['rm', '-Rf', (string)$this->repoPath]))->mustRun(); |
|
| 33 | + (new Process(['rm', '-Rf', (string) $this->repoPath]))->mustRun(); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | private function makeTag(string $tagName) : void |
| 37 | 37 | { |
| 38 | - (new Process(['git', 'tag', $tagName]))->setWorkingDirectory((string)$this->repoPath)->mustRun(); |
|
| 38 | + (new Process(['git', 'tag', $tagName]))->setWorkingDirectory((string) $this->repoPath)->mustRun(); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | public function testFromRepository() : void |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | '1.0.0', |
| 48 | 48 | ], |
| 49 | 49 | array_map( |
| 50 | - function (Version $version) { |
|
| 50 | + function(Version $version) { |
|
| 51 | 51 | return $version->getVersionString(); |
| 52 | 52 | }, |
| 53 | 53 | iterator_to_array((new GetVersionCollectionFromGitRepository())->fromRepository($this->repoPath)) |