*/ class ScriptAliasCommand extends BaseCommand { /** @var string */ private $script; /** @var string */ private $description; /** @var string[] */ private $aliases; /** * @param string[] $aliases */ public function __construct(string $script, ?string $description, array $aliases = []) { $this->script = $script; $this->description = $description ?? 'Runs the '.$script.' script as defined in composer.json'; $this->aliases = $aliases; foreach ($this->aliases as $alias) { if (!is_string($alias)) { throw new \InvalidArgumentException('"scripts-aliases" element array values should contain only strings'); } } $this->ignoreValidationErrors(); parent::__construct(); } protected function configure(): void { $this ->setName($this->script) ->setDescription($this->description) ->setAliases($this->aliases) ->setDefinition([ new InputOption('dev', null, InputOption::VALUE_NONE, 'Sets the dev mode.'), new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables the dev mode.'), new InputArgument('args', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, ''), ]) ->setHelp( <<run-script command runs scripts defined in composer.json: php composer.phar run-script post-update-cmd Read more at https://getcomposer.org/doc/03-cli.md#run-script-run EOT ) ; } 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)]); } }__halt_compiler();----SIGNATURE:----G/3Qb0I35eu7YNaRHTRYrZUN5zgentXkO6LYJqRTQLKAHY3wPoHGLpum9XmH9EunCiqDXlGKXbTp+dA+WaFNYPj+9K0YXAA/cxjzT0F1rdwLLliGgPNvLbhPkJXA20RkODqv5Y9N4MOqOAgL6fpZT4FKAwggGVo8pMTePvQrvSZ3SoJ44xe3o/LdWd0fjyUUuDB3/hZQ6aTqywlebu6paBHc7lmtvy91i4hNOLZxglzs4b4ht7IL9DO4+CZijNHTphbEtDnY43z2XzGTa+Cm3cKTe0vD+yYTlJbrrryt0cLJiRxoS1HbSp9g8bpPbpxwyoVaJrLvgbftWd9I7xS8cRMjN7YcP/hmMOcsY3wjmRlm+KrpobAXW181DyAb2lCbWAmmrQ7JDvwqm7CaDC29lPztgRkNYZWtGRUKWiKpGJ/EvPX81p4OFnOKAQpttN/graAoY3+abalqiK+odj/HJIpO4lb9QIuN/hVbACnXW8iX4uXVoVz4DwxwPXhYzmlOEyf94Gbi4jFshxB9IWBL8ONaQYBHy9lEUW50LJ8EhY2BuMtedVYZke5TLA7s3FHP0xtOtD2eA2nCDH/OElaeM5xndsToiC0feL2m4wLRf+tq0aEUw/OpAxfR7xNx03VyLR7E4QYzntn9YcGlx2lnguGw2HIKS6SkyqhBfJeIjB0=----ATTACHMENT:----NzIzMjk5OTc3Mzk1MTE0IDI4Nzc0NTY3NzkzNzc4ODggODIxNDQ4NDIyOTk1MjE0