function ScriptAliasCommand::execute
Overrides Command::execute
File
-
vendor/
composer/ composer/ src/ Composer/ Command/ ScriptAliasCommand.php, line 76
Class
- ScriptAliasCommand
- @author Jordi Boggiano <j.boggiano@seld.be>
Namespace
Composer\CommandCode
protected function execute(InputInterface $input, OutputInterface $output) : int {
$composer = $this->requireComposer();
$args = $input->getArguments();
// TODO remove for Symfony 6+ as it is then in the interface
if (!method_exists($input, '__toString')) {
// @phpstan-ignore-line
throw new \LogicException('Expected an Input instance that is stringable, got ' . get_class($input));
}
return $composer->getEventDispatcher()
->dispatchScript($this->script, $input->getOption('dev') || !$input->getOption('no-dev'), $args['args'], [
'script-alias-input' => Preg::replace('{^\\S+ ?}', '', $input->__toString(), 1),
]);
}