public static function format(\Reflector $reflector)
    {
        $docblock = new Docblock($reflector);
        $chunks   = [];

        if (!empty($docblock->desc)) {
            $chunks[] = '<comment>Description:</comment>';
            $chunks[] = self::indent(OutputFormatter::escape($docblock->desc), '  ');
            $chunks[] = '';
        }

        if (!empty($docblock->tags)) {
            foreach ($docblock::$vectors as $name => $vector) {
                if (isset($docblock->tags[$name])) {
                    $chunks[] = \sprintf('<comment>%s:</comment>', self::inflect($name));
                    $chunks[] = self::formatVector($vector, $docblock->tags[$name]);
                    $chunks[] = '';
                }
            }

            $tags = self::formatTags(\array_keys($docblock::$vectors), $docblock->tags);
            if (!empty($tags)) {
                $chunks[] = $tags;
                $chunks[] = '';
            }
        }

        return \rtrim(\implode("\n", $chunks));
    }
public static function format(\Reflector $reflector)
    {
        $docblock = new Docblock($reflector);
        $chunks   = [];

        if (!empty($docblock->desc)) {
            $chunks[] = '<comment>Description:</comment>';
            $chunks[] = self::indent(OutputFormatter::escape($docblock->desc), '  ');
            $chunks[] = '';
        }

        if (!empty($docblock->tags)) {
            foreach ($docblock::$vectors as $name => $vector) {
                if (isset($docblock->tags[$name])) {
                    $chunks[] = \sprintf('<comment>%s:</comment>', self::inflect($name));
                    $chunks[] = self::formatVector($vector, $docblock->tags[$name]);
                    $chunks[] = '';
                }
            }

            $tags = self::formatTags(\array_keys($docblock::$vectors), $docblock->tags);
            if (!empty($tags)) {
                $chunks[] = $tags;
                $chunks[] = '';
            }
        }

        return \rtrim(\implode("\n", $chunks));
    }
public static function format ( \ Reflector $ reflector ) { $ docblock = new Docblock ( $ reflector ) ; $ chunks = [ ] ; if ( ! empty ( $ docblock -> desc ) ) { $ chunks [ ] = '<comment>Description:</comment>' ; $ chunks [ ] = self :: indent ( OutputFormatter :: escape ( $ docblock -> desc ) , '  ' ) ; $ chunks [ ] = '' ; } if ( ! empty ( $ docblock -> tags ) ) { foreach ( $ docblock :: $ vectors as $ name => $ vector ) { if ( isset ( $ docblock -> tags [ $ name ] ) ) { $ chunks [ ] = \ sprintf ( '<comment>%s:</comment>' , self :: inflect ( $ name ) ) ; $ chunks [ ] = self :: formatVector ( $ vector , $ docblock -> tags [ $ name ] ) ; $ chunks [ ] = '' ; } } $ tags = self :: formatTags ( \ array_keys ( $ docblock :: $ vectors ) , $ docblock -> tags ) ; if ( ! empty ( $ tags ) ) { $ chunks [ ] = $ tags ; $ chunks [ ] = '' ; } } return \ rtrim ( \ implode ( "\n" , $ chunks ) ) ; }
Format a docblock.

@param \Reflector $reflector

@return string Formatted docblock
Format a docblock .