@@ -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 | |
@@ -119,26 +119,26 @@ discard block |
||
119 | 119 | $toRevision = $this->parseRevision->fromStringForRepository($input->getOption('to'), $sourceRepo); |
120 | 120 | $sourcesPath = $input->getArgument('sources-path'); |
121 | 121 | |
122 | - $output->writeln(sprintf('Comparing from %s to %s...', (string)$fromRevision, (string)$toRevision)); |
|
122 | + $output->writeln(sprintf('Comparing from %s to %s...', (string) $fromRevision, (string) $toRevision)); |
|
123 | 123 | |
124 | 124 | $fromPath = $this->git->checkout($sourceRepo, $fromRevision); |
125 | 125 | $toPath = $this->git->checkout($sourceRepo, $toRevision); |
126 | 126 | |
127 | 127 | try { |
128 | - $fromSources = $fromPath . '/' . $sourcesPath; |
|
129 | - $toSources = $toPath . '/' . $sourcesPath; |
|
128 | + $fromSources = $fromPath.'/'.$sourcesPath; |
|
129 | + $toSources = $toPath.'/'.$sourcesPath; |
|
130 | 130 | |
131 | 131 | Assert::that($fromSources)->directory(); |
132 | 132 | Assert::that($toSources)->directory(); |
133 | 133 | |
134 | 134 | $changes = $this->comparator->compare( |
135 | - $this->reflectorFactory->__invoke((string)$fromPath . '/' . $sourcesPath), |
|
136 | - $this->reflectorFactory->__invoke((string)$toPath . '/' . $sourcesPath) |
|
135 | + $this->reflectorFactory->__invoke((string) $fromPath.'/'.$sourcesPath), |
|
136 | + $this->reflectorFactory->__invoke((string) $toPath.'/'.$sourcesPath) |
|
137 | 137 | ); |
138 | 138 | |
139 | 139 | (new SymfonyConsoleTextFormatter($output))->write($changes); |
140 | 140 | |
141 | - $markdownFile = trim((string)$input->getOption('markdown')); |
|
141 | + $markdownFile = trim((string) $input->getOption('markdown')); |
|
142 | 142 | if ($markdownFile !== '') { |
143 | 143 | $output->write(sprintf('Generating markdown in %s...', $markdownFile)); |
144 | 144 | (new MarkdownFormatter($markdownFile))->write($changes); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | private function parseRevisionFromInput(InputInterface $input, CheckedOutRepository $repository) : Revision |
162 | 162 | { |
163 | 163 | return $this->parseRevision->fromStringForRepository( |
164 | - (string)$input->getOption('from'), |
|
164 | + (string) $input->getOption('from'), |
|
165 | 165 | $repository |
166 | 166 | ); |
167 | 167 | } |
@@ -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\Formatter; |
5 | 5 | |
@@ -26,21 +26,21 @@ discard block |
||
26 | 26 | $this->outputFilename, |
27 | 27 | "# Added\n" |
28 | 28 | . implode('', $this->convertFilteredChangesToMarkdownBulletList( |
29 | - function (Change $change) : bool { |
|
29 | + function(Change $change) : bool { |
|
30 | 30 | return $change->isAdded(); |
31 | 31 | }, |
32 | 32 | ...$arrayOfChanges |
33 | 33 | )) |
34 | 34 | . "\n# Changed\n" |
35 | 35 | . implode('', $this->convertFilteredChangesToMarkdownBulletList( |
36 | - function (Change $change) : bool { |
|
36 | + function(Change $change) : bool { |
|
37 | 37 | return $change->isChanged(); |
38 | 38 | }, |
39 | 39 | ...$arrayOfChanges |
40 | 40 | )) |
41 | 41 | . "\n# Removed\n" |
42 | 42 | . implode('', $this->convertFilteredChangesToMarkdownBulletList( |
43 | - function (Change $change) : bool { |
|
43 | + function(Change $change) : bool { |
|
44 | 44 | return $change->isRemoved(); |
45 | 45 | }, |
46 | 46 | ...$arrayOfChanges |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | private function convertFilteredChangesToMarkdownBulletList(callable $filterFunction, Change ...$changes) : array |
52 | 52 | { |
53 | 53 | return array_map( |
54 | - function (Change $change) : string { |
|
55 | - return ' - ' . str_replace(['ADDED: ', 'CHANGED: ', 'REMOVED: '], '', trim((string)$change)) . "\n"; |
|
54 | + function(Change $change) : string { |
|
55 | + return ' - '.str_replace(['ADDED: ', 'CHANGED: ', 'REMOVED: '], '', trim((string) $change))."\n"; |
|
56 | 56 | }, |
57 | 57 | array_filter($changes, $filterFunction) |
58 | 58 | ); |
@@ -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 | |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | |
57 | 57 | public function setUp() : void |
58 | 58 | { |
59 | - $this->sourceRepository = CheckedOutRepository::fromPath(realpath(__DIR__ . '/../../../')); |
|
60 | - chdir((string)$this->sourceRepository); |
|
59 | + $this->sourceRepository = CheckedOutRepository::fromPath(realpath(__DIR__.'/../../../')); |
|
60 | + chdir((string) $this->sourceRepository); |
|
61 | 61 | |
62 | 62 | $this->input = $this->createMock(InputInterface::class); |
63 | 63 | $this->output = $this->createMock(OutputInterface::class); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $fromSha = sha1('fromRevision', false); |
171 | 171 | $toSha = sha1('toRevision', false); |
172 | 172 | |
173 | - $markdownFilename = tempnam(sys_get_temp_dir(), uniqid('api-compare-', true)) . '.md'; |
|
173 | + $markdownFilename = tempnam(sys_get_temp_dir(), uniqid('api-compare-', true)).'.md'; |
|
174 | 174 | |
175 | 175 | $this->input->expects(self::any())->method('hasOption')->willReturn(true); |
176 | 176 | $this->input->expects(self::any())->method('getOption')->willReturnMap([ |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | |
251 | 251 | $this->parseRevision->expects(self::at(0)) |
252 | 252 | ->method('fromStringForRepository') |
253 | - ->with((string)$pickedVersion) |
|
253 | + ->with((string) $pickedVersion) |
|
254 | 254 | ->willReturn(Revision::fromSha1($fromSha)); |
255 | 255 | $this->parseRevision->expects(self::at(1)) |
256 | 256 | ->method('fromStringForRepository') |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | |
260 | 260 | $this->getVersions->expects(self::once()) |
261 | 261 | ->method('fromRepository') |
262 | - ->with(self::callback(function (CheckedOutRepository $checkedOutRepository) : bool { |
|
262 | + ->with(self::callback(function(CheckedOutRepository $checkedOutRepository) : bool { |
|
263 | 263 | self::assertEquals($this->sourceRepository, $checkedOutRepository); |
264 | 264 | return true; |
265 | 265 | })) |
@@ -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; |
5 | 5 | |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | { |
16 | 16 | $changeText = uniqid('changeText', true); |
17 | 17 | $change = Change::added($changeText, false); |
18 | - self::assertSame(' ADDED: ' . $changeText, (string) $change); |
|
18 | + self::assertSame(' ADDED: '.$changeText, (string) $change); |
|
19 | 19 | self::assertTrue($change->isAdded()); |
20 | 20 | self::assertFalse($change->isChanged()); |
21 | 21 | self::assertFalse($change->isRemoved()); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | { |
26 | 26 | $changeText = uniqid('changeText', true); |
27 | 27 | $change = Change::added($changeText, true); |
28 | - self::assertSame('[BC] ADDED: ' . $changeText, (string) $change); |
|
28 | + self::assertSame('[BC] ADDED: '.$changeText, (string) $change); |
|
29 | 29 | self::assertTrue($change->isAdded()); |
30 | 30 | self::assertFalse($change->isChanged()); |
31 | 31 | self::assertFalse($change->isRemoved()); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | $changeText = uniqid('changeText', true); |
37 | 37 | $change = Change::changed($changeText, false); |
38 | - self::assertSame(' CHANGED: ' . $changeText, (string) $change); |
|
38 | + self::assertSame(' CHANGED: '.$changeText, (string) $change); |
|
39 | 39 | self::assertFalse($change->isAdded()); |
40 | 40 | self::assertTrue($change->isChanged()); |
41 | 41 | self::assertFalse($change->isRemoved()); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | { |
46 | 46 | $changeText = uniqid('changeText', true); |
47 | 47 | $change = Change::changed($changeText, true); |
48 | - self::assertSame('[BC] CHANGED: ' . $changeText, (string) $change); |
|
48 | + self::assertSame('[BC] CHANGED: '.$changeText, (string) $change); |
|
49 | 49 | self::assertFalse($change->isAdded()); |
50 | 50 | self::assertTrue($change->isChanged()); |
51 | 51 | self::assertFalse($change->isRemoved()); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | { |
56 | 56 | $changeText = uniqid('changeText', true); |
57 | 57 | $change = Change::removed($changeText, false); |
58 | - self::assertSame(' REMOVED: ' . $changeText, (string) $change); |
|
58 | + self::assertSame(' REMOVED: '.$changeText, (string) $change); |
|
59 | 59 | self::assertFalse($change->isAdded()); |
60 | 60 | self::assertFalse($change->isChanged()); |
61 | 61 | self::assertTrue($change->isRemoved()); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | { |
66 | 66 | $changeText = uniqid('changeText', true); |
67 | 67 | $change = Change::removed($changeText, true); |
68 | - self::assertSame('[BC] REMOVED: ' . $changeText, (string) $change); |
|
68 | + self::assertSame('[BC] REMOVED: '.$changeText, (string) $change); |
|
69 | 69 | self::assertFalse($change->isAdded()); |
70 | 70 | self::assertFalse($change->isChanged()); |
71 | 71 | self::assertTrue($change->isRemoved()); |
@@ -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 | |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | { |
16 | 16 | public function testWrite() : void |
17 | 17 | { |
18 | - $markdownFilename = tempnam(sys_get_temp_dir(), uniqid('api-compare-', true)) . '.md'; |
|
18 | + $markdownFilename = tempnam(sys_get_temp_dir(), uniqid('api-compare-', true)).'.md'; |
|
19 | 19 | |
20 | 20 | (new MarkdownFormatter($markdownFilename))->write(Changes::fromArray([ |
21 | 21 | Change::added('Something added', true), |