private static function getCommentContent($what)
    {
        $reflector = null;
        if (\is_object($what)) {
            $reflector = $what instanceof \Reflector
                ? $what
                : new \ReflectionObject($what);
            $docComment = $reflector->getDocComment();
        } else {
            // assume string
            $docComment = $what;
        }
        // remove opening "/**" and closing "*/"
        $docComment = \preg_replace('#^/\*\*(.+)\*/$#s', '$1', $docComment);
        // remove leading "*"s
        $docComment = \preg_replace('#^[ \t]*\*[ ]?#m', '', $docComment);
        $docComment = \trim($docComment);
        if ($reflector) {
            if (\strtolower($docComment) == '{@inheritdoc}') {
                return self::findInheritedDoc($reflector);
            } else {
                $docComment = \preg_replace_callback(
                    '/{@inheritdoc}/i',
                    function () use ($reflector) {
                        $phpDoc =  self::findInheritedDoc($reflector);
                        return $phpDoc['description'];
                    },
                    $docComment
                );
            }
        }
        return $docComment;
    }
private static function getCommentContent($what)
    {
        $reflector = null;
        if (\is_object($what)) {
            $reflector = $what instanceof \Reflector
                ? $what
                : new \ReflectionObject($what);
            $docComment = $reflector->getDocComment();
        } else {
            // assume string
            $docComment = $what;
        }
        // remove opening "/**" and closing "*/"
        $docComment = \preg_replace('#^/\*\*(.+)\*/$#s', '$1', $docComment);
        // remove leading "*"s
        $docComment = \preg_replace('#^[ \t]*\*[ ]?#m', '', $docComment);
        $docComment = \trim($docComment);
        if ($reflector) {
            if (\strtolower($docComment) == '{@inheritdoc}') {
                return self::findInheritedDoc($reflector);
            } else {
                $docComment = \preg_replace_callback(
                    '/{@inheritdoc}/i',
                    function () use ($reflector) {
                        $phpDoc =  self::findInheritedDoc($reflector);
                        return $phpDoc['description'];
                    },
                    $docComment
                );
            }
        }
        return $docComment;
    }
private static function getCommentContent ( $ what ) { $ reflector = null ; if ( \ is_object ( $ what ) ) { $ reflector = $ what instanceof \ Reflector ? $ what : new \ ReflectionObject ( $ what ) ; $ docComment = $ reflector -> getDocComment ( ) ; } else { // assume string $ docComment = $ what ; } // remove opening "/**" and closing "*/" $ docComment = \ preg_replace ( '#^/\*\*(.+)\*/$#s' , '$1' , $ docComment ) ; // remove leading "*"s $ docComment = \ preg_replace ( '#^[ \t]*\*[ ]?#m' , '' , $ docComment ) ; $ docComment = \ trim ( $ docComment ) ; if ( $ reflector ) { if ( \ strtolower ( $ docComment ) == '{@inheritdoc}' ) { return self :: findInheritedDoc ( $ reflector ) ; } else { $ docComment = \ preg_replace_callback ( '/{@inheritdoc}/i' , function ( ) use ( $ reflector ) { $ phpDoc = self :: findInheritedDoc ( $ reflector ) ; return $ phpDoc [ 'description' ] ; } , $ docComment ) ; } } return $ docComment ; }
Get comment contents

@param string|object|\Reflector $what doc-block string, object, or reflector object

@return string|array may return array if comment contains an cached inheritdoc
Get comment contents