src/Valkyrja/Console/NativeConsole.php
public function addCommand(Command $command): void
    {
        $command->setMethod($command->getMethod() ?? static::RUN_METHOD);
        $dispatcher = $this->app->dispatcher();

        $dispatcher->verifyClassMethod($command);
        $dispatcher->verifyFunction($command);
        $dispatcher->verifyClosure($command);

        $this->addParsedCommand(
            $command,
            $this->app->pathParser()->parse(
                $command->getPath()
            )
        );
    }
public function addCommand(Command $command): void
    {
        $command->setMethod($command->getMethod() ?? static::RUN_METHOD);
        $dispatcher = $this->app->dispatcher();

        $dispatcher->verifyClassMethod($command);
        $dispatcher->verifyFunction($command);
        $dispatcher->verifyClosure($command);

        $this->addParsedCommand(
            $command,
            $this->app->pathParser()->parse(
                $command->getPath()
            )
        );
    }
Add a new command.

@param Command $command The command

@throws \Valkyrja\Dispatcher\Exceptions\InvalidClosureException
@throws \Valkyrja\Dispatcher\Exceptions\InvalidDispatchCapabilityException
@throws \Valkyrja\Dispatcher\Exceptions\InvalidFunctionException
@throws \Valkyrja\Dispatcher\Exceptions\InvalidMethodException
@throws \Valkyrja\Dispatcher\Exceptions\InvalidPropertyException

@return void