@@ -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\Command; |
5 | 5 | |
@@ -108,22 +108,22 @@ discard block |
||
108 | 108 | $toRevision = $this->parseRevision->fromStringForRepository($input->getOption('to'), $sourceRepo); |
109 | 109 | $sourcesPath = $input->getArgument('sources-path'); |
110 | 110 | |
111 | - $output->writeln(sprintf('Comparing from %s to %s...', (string)$fromRevision, (string)$toRevision)); |
|
111 | + $output->writeln(sprintf('Comparing from %s to %s...', (string) $fromRevision, (string) $toRevision)); |
|
112 | 112 | |
113 | 113 | $fromPath = $this->git->checkout($sourceRepo, $fromRevision); |
114 | 114 | $toPath = $this->git->checkout($sourceRepo, $toRevision); |
115 | 115 | |
116 | 116 | try { |
117 | - $fromSources = $fromPath . '/' . $sourcesPath; |
|
118 | - $toSources = $toPath . '/' . $sourcesPath; |
|
117 | + $fromSources = $fromPath.'/'.$sourcesPath; |
|
118 | + $toSources = $toPath.'/'.$sourcesPath; |
|
119 | 119 | |
120 | 120 | Assert::that($fromSources)->directory(); |
121 | 121 | Assert::that($toSources)->directory(); |
122 | 122 | |
123 | 123 | (new SymfonyConsoleTextFormatter($output))->write( |
124 | 124 | (new Comparator())->compare( |
125 | - $this->reflectorFactory->__invoke((string)$fromPath . '/' . $sourcesPath), |
|
126 | - $this->reflectorFactory->__invoke((string)$toPath . '/' . $sourcesPath) |
|
125 | + $this->reflectorFactory->__invoke((string) $fromPath.'/'.$sourcesPath), |
|
126 | + $this->reflectorFactory->__invoke((string) $toPath.'/'.$sourcesPath) |
|
127 | 127 | ) |
128 | 128 | ); |
129 | 129 | } finally { |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | private function parseRevisionFromInput(InputInterface $input, CheckedOutRepository $repository) : Revision |
142 | 142 | { |
143 | 143 | return $this->parseRevision->fromStringForRepository( |
144 | - (string)$input->getOption('from'), |
|
144 | + (string) $input->getOption('from'), |
|
145 | 145 | $repository |
146 | 146 | ); |
147 | 147 | } |
@@ -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 @@ 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)) |
@@ -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 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $expectedRevision, |
31 | 31 | (new GitParseRevision())->fromStringForRepository( |
32 | 32 | $revisionToBeParsed, |
33 | - CheckedOutRepository::fromPath(__DIR__ . '/../../../') |
|
33 | + CheckedOutRepository::fromPath(__DIR__.'/../../../') |
|
34 | 34 | )->__toString() |
35 | 35 | ); |
36 | 36 | } |
@@ -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 |