Skip to content

Commit 0de8734

Browse files
bert-wtaylorotwell
andauthored
[9.x] Improve input argument parsing for commands (#44662)
* Update Application.php * Update Application.php Co-authored-by: Taylor Otwell <[email protected]>
1 parent 9fed2b4 commit 0de8734

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Illuminate/Console/Application.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Symfony\Component\Console\Application as SymfonyApplication;
1414
use Symfony\Component\Console\Command\Command as SymfonyCommand;
1515
use Symfony\Component\Console\Exception\CommandNotFoundException;
16+
use Symfony\Component\Console\Exception\ExceptionInterface;
1617
use Symfony\Component\Console\Input\ArgvInput;
1718
use Symfony\Component\Console\Input\ArrayInput;
1819
use Symfony\Component\Console\Input\InputDefinition;
@@ -93,6 +94,12 @@ public function run(InputInterface $input = null, OutputInterface $output = null
9394
$input = $input ?: new ArgvInput
9495
);
9596

97+
try {
98+
$input->bind($this->find($commandName)->getDefinition());
99+
} catch (ExceptionInterface) {
100+
// ...
101+
}
102+
96103
$this->events->dispatch(
97104
new CommandStarting(
98105
$commandName, $input, $output = $output ?: new BufferedConsoleOutput

0 commit comments

Comments
 (0)