CraftCli\Application::registerCommand PHP Method

registerCommand() public method

Add a command to the Application by class name or callback that return a Command class
public registerCommand ( string | callable $class ) : void
$class string | callable class name or callback that returns a command
return void
    public function registerCommand($class)
    {
        // is it a callback or a string?
        if (is_callable($class)) {
            $this->add(call_user_func($class, $this));
        } else {
            $this->add(new $class());
        }
    }