src/Reflection/ReflectionClass.php
private function parseDocComment($loc): string
    {
        $tokens = $this->getTokenStream();

        // Look back from T_PUBLIC, T_PROTECTED, T_PRIVATE or T_CLASS
        // for the T_DOC_COMMENT token
        $loc = $tokens->previous($loc, [T_WHITESPACE, T_STATIC, T_FINAL]);

        // Check for doc comment
        if ($loc && $tokens->type($loc) === T_DOC_COMMENT) {
            $doc_comment = $tokens->value($loc);
            // strip off indentation
            $doc_comment = preg_replace('/^[ \t]*\*/m', ' *', $doc_comment);

            return $doc_comment;
        }

        return '';
    }
private function parseDocComment($loc): string
    {
        $tokens = $this->getTokenStream();

        // Look back from T_PUBLIC, T_PROTECTED, T_PRIVATE or T_CLASS
        // for the T_DOC_COMMENT token
        $loc = $tokens->previous($loc, [T_WHITESPACE, T_STATIC, T_FINAL]);

        // Check for doc comment
        if ($loc && $tokens->type($loc) === T_DOC_COMMENT) {
            $doc_comment = $tokens->value($loc);
            // strip off indentation
            $doc_comment = preg_replace('/^[ \t]*\*/m', ' *', $doc_comment);

            return $doc_comment;
        }

        return '';
    }
private function parseDocComment ( $ loc ) : string { $ tokens = $ this -> getTokenStream ( ) ; // Look back from T_PUBLIC, T_PROTECTED, T_PRIVATE or T_CLASS // for the T_DOC_COMMENT token $ loc = $ tokens -> previous ( $ loc , [ T_WHITESPACE , T_STATIC , T_FINAL ] ) ; // Check for doc comment if ( $ loc && $ tokens -> type ( $ loc ) === T_DOC_COMMENT ) { $ doc_comment = $ tokens -> value ( $ loc ) ; // strip off indentation $ doc_comment = preg_replace ( '/^[ \t]*\*/m' , ' *' , $ doc_comment ) ; return $ doc_comment ; } return '' ; }
Returns the doc comment for a property, method or class. The comment is
stripped of leading whitespaces. Returns an empty string if no doc-
comment or an empty doc comment was found.

@param int $loc location of the visibility modifier or T_CLASS

@return string the contents of the doc comment
Returns the doc comment for a property method or class . The comment is stripped of leading whitespaces . Returns an empty string if no doc - comment or an empty doc comment was found .