signature = $signature; $this->parameterParser = $container->get(ParameterParser::class); parent::__construct(); $options = $this->parameterParser->parseClosureOptions($closure); $definition = $this->getDefinition(); foreach ($options as $option) { $name = $option->getName(); $snakeName = Str::snake($option->getName(), '-'); if ( $definition->hasOption($name) || $definition->hasArgument($name) || $definition->hasOption($snakeName) || $definition->hasArgument($snakeName) ) { continue; } $definition->addOption($option); } } public function handle() { $inputs = array_merge($this->input->getArguments(), $this->input->getOptions()); $parameters = $this->parameterParser->parseClosureParameters($this->closure, $inputs); $this->closure->call($this, ...$parameters); } public function describe(string $description): self { $this->setDescription($description); return $this; } /** * @param null|callable(Crontab $crontab):Crontab $callback */ public function cron(string $rule, array $arguments = [], ?callable $callback = null): self { tap( Schedule::command($this->getName(), $arguments) ->setName($this->getName()) ->setRule($rule) ->setMemo($this->getDescription()), $callback ); return $this; } }