*/ 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:----vceyq+ulcv78aQXVFV6dtT/tzCQubSm7CybF/T02DYbAQWnGR/cVnHaQcydLUU0bryKXYqzYOQFFkgwHR9jHHaARQpC7Qx1CAKkesg0Rb4YqEajAO9Dvf+/z7WNR4RLSu4wL6GktmkbLVUGiVFShKIHb45scw0D/nWQ3CPQfnRZXtUNKps6AIn7LI0WfC6w9I599l6EJty+XBMc7H45q01N3AmvQS9A04QRR4r2vga02jATlldoPgUzqjzpLNGwP9k/8UFLd2a6WS6ZDgCkXk5l8qbnoorKZRG+tgoCBh59WF7W9O2TEepz6pXkJKF/TVT3DhwOkW4Hw4b7xVtIESZNxBWWJNacsjT4awqdWPKm2GwgX7QE3YuQXhlOTb7w3GgOJH4VYxBCiu+vdPlIpnuABeaMgvgsTlPkoUtXfE/psSd3L3C3UdJS2YUoKUvdEcz93yxVGCQ3Wk3Jz4DVJc8zmCYxPGe0sS2CSQe2gqgU9eYHH1YsciBueSJsm0pExTw9Lw/foFcZUG1Syr0Jw3kiY0zWfKV/CAvtt7k0psfablb4HL0RAmjuXiofBEmz9yn/hi7LBVKOHyStvybW054RdRKNn0/lWYaU38dnbCPF3ilFUL+Lb7vJMNJyRYVC7PqnwiW8sLlTSOeSqhu1JVfHXJOdAks5PtMHKhEQRQCc=----ATTACHMENT:----MjYxOTAxODY2OTE5MzI3IDY4NjEwMzMxOTE2MzY2NjAgMzkzNTQ3Mjk4NjQzOTUzMg==