@@ -59,7 +59,7 @@ |
||
59 | 59 | */ |
60 | 60 | public function handle(Event $event): void |
61 | 61 | { |
62 | - if (!IOUtil::answerToBool($event->io()->ask(PHP_EOL . $this->question . ' ', $this->default ? 'y' : 'n'))) { |
|
62 | + if (!IOUtil::answerToBool($event->io()->ask(PHP_EOL . $this->question . ' ', $this->default ? 'y' : 'n'))) { |
|
63 | 63 | throw new ActionFailed('no confirmation, abort!'); |
64 | 64 | } |
65 | 65 | } |
@@ -166,7 +166,7 @@ |
||
166 | 166 | $repo = new Repository($fakeRepo->getRoot()); |
167 | 167 | |
168 | 168 | $config->method('isHookEnabled')->willReturnCallback( |
169 | - function (string $hook): bool { |
|
169 | + function(string $hook): bool { |
|
170 | 170 | return $hook === 'pre-push'; |
171 | 171 | } |
172 | 172 | ); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | ); |
82 | 82 | |
83 | 83 | if (IOUtil::answerToBool($answer)) { |
84 | - $call = '\\CaptainHook' . '\\App' . '\\Hook\\PHP\\Action\\Linting'; |
|
84 | + $call = '\\CaptainHook' . '\\App' . '\\Hook\\PHP\\Action\\Linting'; |
|
85 | 85 | $config->addAction(new Config\Action($call)); |
86 | 86 | } |
87 | 87 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | ); |
125 | 125 | |
126 | 126 | if (IOUtil::answerToBool($answer)) { |
127 | - $call = $this->io->ask( |
|
127 | + $call = $this->io->ask( |
|
128 | 128 | ' <info>Enter the phpcs command you want to execute.</info> ' |
129 | 129 | . '<comment>[phpcs --standard=psr2 src]</comment> ', |
130 | 130 | 'phpcs --standard=psr2 src' |
@@ -109,7 +109,7 @@ |
||
109 | 109 | |
110 | 110 | $executableInclude = substr($executablePath, 0, 1) == '/' |
111 | 111 | ? '\'' . $executablePath . '\'' |
112 | - : '__DIR__ . \'/../../' . $executablePath . '\''; |
|
112 | + : '__DIR__ . \'/../../' . $executablePath . '\''; |
|
113 | 113 | |
114 | 114 | $bootstrapOption = $this->getBootstrapCmdOption(); |
115 | 115 | $bootstrapOptionQuoted = empty($bootstrapOption) ? '' : ' \'' . $bootstrapOption . '\','; |
@@ -63,7 +63,7 @@ |
||
63 | 63 | { |
64 | 64 | $arg = new Arg( |
65 | 65 | $hook, |
66 | - static function (string $hook): bool { |
|
66 | + static function(string $hook): bool { |
|
67 | 67 | return !HookUtil::isValid($hook); |
68 | 68 | } |
69 | 69 | ); |
@@ -84,7 +84,7 @@ |
||
84 | 84 | { |
85 | 85 | $arg = new Arg( |
86 | 86 | $hook, |
87 | - static function (string $hook): bool { |
|
87 | + static function(string $hook): bool { |
|
88 | 88 | return !HookUtil::isInstallable($hook); |
89 | 89 | } |
90 | 90 | ); |
@@ -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) { |
@@ -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>"); |