*/ 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:----XOfrb0KPp5zMiRarEICEhuLMSSeIo6hmujqlOjojRlrGN3UGGs8U3r5ivWCS9jpy3tquqM1Za2WoCNK56wy/eq/tbLX+04rcutxk69ed6h4RMYBd1hdYUn1IwG3gz+mNBW4xZx3NdW3JH2nN8TlsHvZ52waAnwf2xlIAxXw1LVaHQO9N2hfYeP2CCM38padiCqvXZRM6ameqj4e/prh9CjxXYf/0vvCpRY04GUfcU48N26HOXWsyh6hsQrKQnp4usXIjDzKSzLID9p7u8jrj+MhtkYEN9OesZZzVw9HOfbibCKGNqJps8qfm8MBsWo4pBGmUwiF0T12kkqKeKjc+OERFesJbb3aUft9K+KUTio8WJnWeNuTwozIHrdrVvSawo14Z6ExXJTFq/3ZrWzaUTemXS954pPg3y/6AjHLzTwbc0HHCbXKbxa0tN73j41/oWLJ9LX7lUlXKgWyxo4ubY+ncDiezzF6EK5V2H9Mw9bl0AaN4gPZ4+75o1p0xNZCEFGHuKxHk1z6ALnDqCFO/A5EJjU1LuBl6bb3olrntWoKdX+WSac/1IBDImUC5k601hVW6BCcSCJTilTyi0x0CXTd9PjKdGpManEBFQHbBzO0z9cfJfPTQ6qDrta0lEOAI2cclEXQ2NYs2ZrgrYRbYeRpHRNdRNBsORr8DpK7r3Vw=----ATTACHMENT:----ODAyNTE0MTA3MjAxNjk3NSA1MzQyNjc0NTkwNDA2NDA0IDc4NTg4MDg3NTAwNDI2ODc=