protected function findCommentEndIndex(File $file, $elementIndex)
    {
        $searchTypes   = array_merge(Tokens::$methodPrefixes, [T_WHITESPACE]);
        $previousToken = $file->findPrevious($searchTypes, $elementIndex - 1, null, true);
        if ($previousToken
            && $file->getTokens()[$previousToken]['code'] == T_DOC_COMMENT_CLOSE_TAG
        ) {
            return $previousToken;
        }

        return false;
    }
protected function findCommentEndIndex(File $file, $elementIndex)
    {
        $searchTypes   = array_merge(Tokens::$methodPrefixes, [T_WHITESPACE]);
        $previousToken = $file->findPrevious($searchTypes, $elementIndex - 1, null, true);
        if ($previousToken
            && $file->getTokens()[$previousToken]['code'] == T_DOC_COMMENT_CLOSE_TAG
        ) {
            return $previousToken;
        }

        return false;
    }
protected function findCommentEndIndex ( File $ file , $ elementIndex ) { $ searchTypes = array_merge ( Tokens :: $ methodPrefixes , [ T_WHITESPACE ] ) ; $ previousToken = $ file -> findPrevious ( $ searchTypes , $ elementIndex - 1 , null , true ) ; if ( $ previousToken && $ file -> getTokens ( ) [ $ previousToken ] [ 'code' ] == T_DOC_COMMENT_CLOSE_TAG ) { return $ previousToken ; } return false ; }
Gets the end of a PHPDoc comment that is directly above an element.

@param File $file
@param int  $elementIndex

@return bool|int
Gets the end of a PHPDoc comment that is directly above an element .