function TraceableCommand::setCode
Calling parent method is required to be used in {
Overrides Command::setCode
See also
parent::run()}.
1 call to TraceableCommand::setCode()
- TraceableCommand::__construct in vendor/
symfony/ console/ Command/ TraceableCommand.php
File
-
vendor/
symfony/ console/ Command/ TraceableCommand.php, line 172
Class
- TraceableCommand
- @internal
Namespace
Symfony\Component\Console\CommandCode
public function setCode(callable $code) : static {
$this->command
->setCode($code);
return parent::setCode(function (InputInterface $input, OutputInterface $output) use ($code) : int {
$event = $this->stopwatch
->start($this->getName() . '.code');
$this->exitCode = $code($input, $output);
$event->stop();
return $this->exitCode;
});
}