function TraceableCommand::__construct
Overrides Command::__construct
File
-
vendor/
symfony/ console/ Command/ TraceableCommand.php, line 49
Class
- TraceableCommand
- @internal
Namespace
Symfony\Component\Console\CommandCode
public function __construct(Command $command, Stopwatch $stopwatch) {
if ($command instanceof LazyCommand) {
$command = $command->getCommand();
}
$this->command = $command;
// prevent call to self::getDefaultDescription()
$this->setDescription($command->getDescription());
parent::__construct($command->getName());
// init below enables calling {@see parent::run()}
[
$code,
$processTitle,
$ignoreValidationErrors,
] = \Closure::bind(function () {
return [
$this->code,
$this->processTitle,
$this->ignoreValidationErrors,
];
}, $command, Command::class)();
if (\is_callable($code)) {
$this->setCode($code);
}
if ($processTitle) {
parent::setProcessTitle($processTitle);
}
if ($ignoreValidationErrors) {
parent::ignoreValidationErrors();
}
$this->ignoreValidation = $ignoreValidationErrors;
}