Superbrave/Sniffs/Commenting/FunctionCommentSniff.php
protected function getDocBlock(File $phpcsFile, $stackPtr, &$startToken = null, &$endToken = null)
    {
        // Fetches the full function docblock
        $startToken = $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, $stackPtr - 1);
        if ($startToken === false) {
            return '';
        }
        $endToken = $phpcsFile->findNext(T_DOC_COMMENT_CLOSE_TAG, $startToken);
        if ($endToken === false) {
            return '';
        }
        return $phpcsFile->getTokensAsString($startToken, ($endToken - $startToken));
    }
protected function getDocBlock(File $phpcsFile, $stackPtr, &$startToken = null, &$endToken = null)
    {
        // Fetches the full function docblock
        $startToken = $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, $stackPtr - 1);
        if ($startToken === false) {
            return '';
        }
        $endToken = $phpcsFile->findNext(T_DOC_COMMENT_CLOSE_TAG, $startToken);
        if ($endToken === false) {
            return '';
        }
        return $phpcsFile->getTokensAsString($startToken, ($endToken - $startToken));
    }
protected function getDocBlock ( File $ phpcsFile , $ stackPtr , & $ startToken = null , & $ endToken = null ) { // Fetches the full function docblock $ startToken = $ phpcsFile -> findPrevious ( T_DOC_COMMENT_OPEN_TAG , $ stackPtr - 1 ) ; if ( $ startToken === false ) { return '' ; } $ endToken = $ phpcsFile -> findNext ( T_DOC_COMMENT_CLOSE_TAG , $ startToken ) ; if ( $ endToken === false ) { return '' ; } return $ phpcsFile -> getTokensAsString ( $ startToken , ( $ endToken - $ startToken ) ) ; }
Fetches the docblock as string

@param File     $phpcsFile  The file being scanned.
@param int      $stackPtr   The position of the current token in the stack passed in $tokens.
@param int|bool $startToken By reference; the token where the docblock starts
@param int|bool $endToken   By reference; the token where the docblock ends

@return string
Fetches the docblock as string