protected function showHelp(string $for, array $items, string $header = '', string $footer = '')
    {
        if ($header) {
            $this->writer->bold($header, true);
        }

        $this->writer->eol()->boldGreen($for . ':', true);

        if (empty($items)) {
            $this->writer->bold('  (n/a)', true);

            return;
        }

        $space = 4;
        foreach ($this->sortItems($items, $padLen) as $item) {
            $name = $this->getName($item);
            $desc = \str_replace(["\r\n", "\n"], \str_pad("\n", $padLen + $space + 3), $item->desc());

            $this->writer->bold('  ' . \str_pad($name, $padLen + $space));
            $this->writer->comment($desc, true);
        }

        if ($footer) {
            $this->writer->eol()->yellow($footer, true);
        }
    }
protected function showHelp(string $for, array $items, string $header = '', string $footer = '')
    {
        if ($header) {
            $this->writer->bold($header, true);
        }

        $this->writer->eol()->boldGreen($for . ':', true);

        if (empty($items)) {
            $this->writer->bold('  (n/a)', true);

            return;
        }

        $space = 4;
        foreach ($this->sortItems($items, $padLen) as $item) {
            $name = $this->getName($item);
            $desc = \str_replace(["\r\n", "\n"], \str_pad("\n", $padLen + $space + 3), $item->desc());

            $this->writer->bold('  ' . \str_pad($name, $padLen + $space));
            $this->writer->comment($desc, true);
        }

        if ($footer) {
            $this->writer->eol()->yellow($footer, true);
        }
    }
protected function showHelp ( string $ for , array $ items , string $ header = '' , string $ footer = '' ) { if ( $ header ) { $ this -> writer -> bold ( $ header , true ) ; } $ this -> writer -> eol ( ) -> boldGreen ( $ for . ':' , true ) ; if ( empty ( $ items ) ) { $ this -> writer -> bold ( '  (n/a)' , true ) ; return ; } $ space = 4 ; foreach ( $ this -> sortItems ( $ items , $ padLen ) as $ item ) { $ name = $ this -> getName ( $ item ) ; $ desc = \ str_replace ( [ "\r\n" , "\n" ] , \ str_pad ( "\n" , $ padLen + $ space + 3 ) , $ item -> desc ( ) ) ; $ this -> writer -> bold ( '  ' . \ str_pad ( $ name , $ padLen + $ space ) ) ; $ this -> writer -> comment ( $ desc , true ) ; } if ( $ footer ) { $ this -> writer -> eol ( ) -> yellow ( $ footer , true ) ; } }
Show help with headers and footers.

@param string $for
@param array  $items
@param string $header
@param string $footer

@return void
Show help with headers and footers .