src/Viserio/Component/Console/Application.php
public function command(string $expression, $callable, array $aliases = []): StringCommand
    {
        $commandResolver = new CommandResolver($this->getInvoker(), $this);
        $command         = $commandResolver->resolve($expression, $callable, $aliases);

        $this->add($command);

        return $command;
    }
public function command(string $expression, $callable, array $aliases = []): StringCommand
    {
        $commandResolver = new CommandResolver($this->getInvoker(), $this);
        $command         = $commandResolver->resolve($expression, $callable, $aliases);

        $this->add($command);

        return $command;
    }
Add a command to the console.

@param string                $expression defines the arguments and options of the command
@param array|callable|string $callable   Called when the command is called.
When using a container, this can be a "pseudo-callable"
i.e. the name of the container entry to invoke.
@param array                 $aliases    an array of aliases for the command

@throws \Viserio\Component\Contract\Console\Exception\InvocationException

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