function Command::mergeApplicationDefinition
Merges the application definition with the command definition.
This method is not part of public API and should not be used directly.
@internal
Parameters
bool $mergeArgs Whether to merge or not the Application definition arguments to Command definition arguments:
1 call to Command::mergeApplicationDefinition()
- Command::run in vendor/
symfony/ console/ Command/ Command.php - Runs the command.
2 methods override Command::mergeApplicationDefinition()
- LazyCommand::mergeApplicationDefinition in vendor/
symfony/ console/ Command/ LazyCommand.php - @internal
- TraceableCommand::mergeApplicationDefinition in vendor/
symfony/ console/ Command/ TraceableCommand.php - @internal
File
-
vendor/
symfony/ console/ Command/ Command.php, line 344
Class
- Command
- Base class for all commands.
Namespace
Symfony\Component\Console\CommandCode
public function mergeApplicationDefinition(bool $mergeArgs = true) : void {
if (null === $this->application) {
return;
}
$this->fullDefinition = new InputDefinition();
$this->fullDefinition
->setOptions($this->definition
->getOptions());
$this->fullDefinition
->addOptions($this->application
->getDefinition()
->getOptions());
if ($mergeArgs) {
$this->fullDefinition
->setArguments($this->application
->getDefinition()
->getArguments());
$this->fullDefinition
->addArguments($this->definition
->getArguments());
}
else {
$this->fullDefinition
->setArguments($this->definition
->getArguments());
}
}