@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | $runner = new Reader($io, $config, $repo); |
| 38 | 38 | $runner->setHook('pre-commit') |
| 39 | - ->run(); |
|
| 39 | + ->run(); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | public function testDoesNotAllowInvalidHookNames(): void |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | $runner = new Reader($io, $config, $repo); |
| 51 | 51 | $runner->setHook('foo') |
| 52 | - ->run(); |
|
| 52 | + ->run(); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | public function testItDisplaysOnlyActions(): void |
@@ -63,8 +63,8 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | $runner = new Reader($io, $config, $repo); |
| 65 | 65 | $runner->setHook('pre-commit') |
| 66 | - ->display(Reader::OPT_ACTIONS, true) |
|
| 67 | - ->run(); |
|
| 66 | + ->display(Reader::OPT_ACTIONS, true) |
|
| 67 | + ->run(); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | public function testItDisplaysActionsAndConditions(): void |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | $input = new ArrayInput(['--version' => true]); |
| 28 | 28 | $output = $this->getMockBuilder(NullOutput::class) |
| 29 | - ->disableOriginalConstructor() |
|
| 30 | - ->getMock(); |
|
| 29 | + ->disableOriginalConstructor() |
|
| 30 | + ->getMock(); |
|
| 31 | 31 | |
| 32 | 32 | $output->expects($this->once())->method('writeLn'); |
| 33 | 33 | |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | { |
| 47 | 47 | $input = new ArrayInput(['command' => 'list']); |
| 48 | 48 | $output = $this->getMockBuilder(NullOutput::class) |
| 49 | - ->disableOriginalConstructor() |
|
| 50 | - ->getMock(); |
|
| 49 | + ->disableOriginalConstructor() |
|
| 50 | + ->getMock(); |
|
| 51 | 51 | |
| 52 | 52 | $app = new Application('captainhook'); |
| 53 | 53 | $app->setAutoExit(false); |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | * @param bool $assoc |
| 32 | 32 | * @return \stdClass|array<string, mixed>|null |
| 33 | 33 | */ |
| 34 | - public function read(bool $assoc = false): array|stdClass|null |
|
| 34 | + public function read(bool $assoc = false): array | stdClass | null |
|
| 35 | 35 | { |
| 36 | 36 | $json = json_decode(parent::read(), $assoc); |
| 37 | 37 | if (json_last_error() !== JSON_ERROR_NONE) { |
@@ -142,9 +142,9 @@ |
||
| 142 | 142 | |
| 143 | 143 | // combine all the parts to create a new commit message |
| 144 | 144 | $msgText = $msgData[self::TARGET_SUBJECT] . PHP_EOL |
| 145 | - . PHP_EOL |
|
| 146 | - . $msgData[self::TARGET_BODY] . PHP_EOL |
|
| 147 | - . $msg->getComments(); |
|
| 145 | + . PHP_EOL |
|
| 146 | + . $msgData[self::TARGET_BODY] . PHP_EOL |
|
| 147 | + . $msg->getComments(); |
|
| 148 | 148 | |
| 149 | 149 | return new CommitMessage($msgText, $msg->getCommentCharacter()); |
| 150 | 150 | } |
@@ -162,7 +162,7 @@ |
||
| 162 | 162 | { |
| 163 | 163 | $issueID = preg_replace_callback( |
| 164 | 164 | '/\$(\d+)/', |
| 165 | - function ($matches) use ($issueID) { |
|
| 165 | + function($matches) use ($issueID) { |
|
| 166 | 166 | return $matches[1] === '1' ? $issueID : ''; |
| 167 | 167 | }, |
| 168 | 168 | $pattern |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $this->io->write('<info>Unstaged intent-to-add files detected.</info>'); |
| 121 | 121 | |
| 122 | 122 | $this->repository->getIndexOperator()->removeFiles( |
| 123 | - array_map(function (Path $path): string { |
|
| 123 | + array_map(function(Path $path): string { |
|
| 124 | 124 | return $path->getPath(); |
| 125 | 125 | }, $this->intentToAddFiles), |
| 126 | 126 | false, |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | $this->repository->getIndexOperator()->recordIntentToAddFiles( |
| 144 | - array_map(function (Path $path): string { |
|
| 144 | + array_map(function(Path $path): string { |
|
| 145 | 145 | return $path->getPath(); |
| 146 | 146 | }, $this->intentToAddFiles) |
| 147 | 147 | ); |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | |
| 202 | 202 | // At this point, the working tree should be pristine, so the |
| 203 | 203 | // patch should cleanly apply. |
| 204 | - $this->applyPatch((string)$this->unstagedPatchFile); |
|
| 204 | + $this->applyPatch((string) $this->unstagedPatchFile); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | $this->io->write("<info>Restored changes from {$this->unstagedPatchFile}.</info>"); |