Skip to content

Commit d95603b

Browse files
committed
Leverage non-capturing catches
1 parent caa47f8 commit d95603b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Application.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public function doRun(InputInterface $input, OutputInterface $output)
228228
try {
229229
// Makes ArgvInput::getFirstArgument() able to distinguish an option from an argument.
230230
$input->bind($this->getDefinition());
231-
} catch (ExceptionInterface $e) {
231+
} catch (ExceptionInterface) {
232232
// Errors must be ignored, full binding/validation happens later when the command is known.
233233
}
234234

@@ -993,7 +993,7 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI
993993
try {
994994
$command->mergeApplicationDefinition();
995995
$input->bind($command->getDefinition());
996-
} catch (ExceptionInterface $e) {
996+
} catch (ExceptionInterface) {
997997
// ignore invalid options/arguments for now, to allow the event listeners to customize the InputDefinition
998998
}
999999

Command/CompleteCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ private function createCompletionInput(InputInterface $input): CompletionInput
184184

185185
try {
186186
$completionInput->bind($this->getApplication()->getDefinition());
187-
} catch (ExceptionInterface $e) {
187+
} catch (ExceptionInterface) {
188188
}
189189

190190
return $completionInput;
@@ -199,7 +199,7 @@ private function findCommand(CompletionInput $completionInput, OutputInterface $
199199
}
200200

201201
return $this->getApplication()->find($inputName);
202-
} catch (CommandNotFoundException $e) {
202+
} catch (CommandNotFoundException) {
203203
}
204204

205205
return null;

Completion/CompletionInput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ protected function parseToken(string $token, bool $parseOptions): bool
183183
{
184184
try {
185185
return parent::parseToken($token, $parseOptions);
186-
} catch (RuntimeException $e) {
186+
} catch (RuntimeException) {
187187
// suppress errors, completed input is almost never valid
188188
}
189189

0 commit comments

Comments
 (0)