src/Command/Command.php
protected function commandHandler(string $command)
    {
        $serverCommand = new ServerCommand();

        if ('-h' == $command || '--help' == $command) {
            echo $serverCommand->desc, PHP_EOL;

            return;
        }

        if ('-v' == $command || '--version' == $command) {
            echo $serverCommand->logo, PHP_EOL;

            return;
        }

        if (!$command || !method_exists($serverCommand, $command)) {
            echo $serverCommand->usage, PHP_EOL;

            return;
        }

        PhpHelper::call([$serverCommand, $command]);
    }
protected function commandHandler(string $command)
    {
        $serverCommand = new ServerCommand();

        if ('-h' == $command || '--help' == $command) {
            echo $serverCommand->desc, PHP_EOL;

            return;
        }

        if ('-v' == $command || '--version' == $command) {
            echo $serverCommand->logo, PHP_EOL;

            return;
        }

        if (!$command || !method_exists($serverCommand, $command)) {
            echo $serverCommand->usage, PHP_EOL;

            return;
        }

        PhpHelper::call([$serverCommand, $command]);
    }
处理命令

@param string $command