src/Viserio/Component/Console/Command/CommandResolver.php
private static function createCommand(string $expression, callable $callable): StringCommand
    {
        $result = ExpressionParser::parse($expression);

        $command = new StringCommand($result['name']);
        $command->getDefinition()->addArguments($result['arguments']);
        $command->getDefinition()->addOptions($result['options']);
        $command->setCode($callable);

        return $command;
    }
private static function createCommand(string $expression, callable $callable): StringCommand
    {
        $result = ExpressionParser::parse($expression);

        $command = new StringCommand($result['name']);
        $command->getDefinition()->addArguments($result['arguments']);
        $command->getDefinition()->addOptions($result['options']);
        $command->setCode($callable);

        return $command;
    }
Create a new command.

@param string   $expression
@param callable $callable

@throws \Symfony\Component\Console\Exception\LogicException
@throws \Symfony\Component\Console\Exception\InvalidArgumentException
@throws \Viserio\Component\Contract\Console\Exception\InvalidCommandExpression

@return \Viserio\Component\Console\Command\StringCommand