protected function defaults(): self
    {
        $this->option('-h, --help', 'Show help')->on([$this, 'showHelp']);
        $this->option('-V, --version', 'Show version')->on([$this, 'showVersion']);
        $this->option('-v, --verbosity', 'Verbosity level', null, 0)->on(function () {
            $this->set('verbosity', ($this->verbosity ?? 0) + 1);

            return false;
        });

        // @codeCoverageIgnoreStart
        $this->onExit(function ($exitCode = 0) {
            exit($exitCode);
        });
        // @codeCoverageIgnoreEnd

        return $this;
    }
protected function defaults(): self
    {
        $this->option('-h, --help', 'Show help')->on([$this, 'showHelp']);
        $this->option('-V, --version', 'Show version')->on([$this, 'showVersion']);
        $this->option('-v, --verbosity', 'Verbosity level', null, 0)->on(function () {
            $this->set('verbosity', ($this->verbosity ?? 0) + 1);

            return false;
        });

        // @codeCoverageIgnoreStart
        $this->onExit(function ($exitCode = 0) {
            exit($exitCode);
        });
        // @codeCoverageIgnoreEnd

        return $this;
    }
protected function defaults ( ) : self { $ this -> option ( '-h, --help' , 'Show help' ) -> on ( [ $ this , 'showHelp' ] ) ; $ this -> option ( '-V, --version' , 'Show version' ) -> on ( [ $ this , 'showVersion' ] ) ; $ this -> option ( '-v, --verbosity' , 'Verbosity level' , null , 0 ) -> on ( function ( ) { $ this -> set ( 'verbosity' , ( $ this -> verbosity ?? 0 ) + 1 ) ; return false ; } ) ; // @codeCoverageIgnoreStart $ this -> onExit ( function ( $ exitCode = 0 ) { exit ( $ exitCode ) ; } ) ; // @codeCoverageIgnoreEnd return $ this ; }
Sets default options, actions and exit handler.

@return self
Sets default options actions and exit handler .