extensions/felixfbecker.php-intellisense-0.0.12/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php
/**
     * Processes this test, when one of its tokens is encountered.
     *
     * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
     * @param int                  $stackPtr  The position of the current token
     *                                        in the stack passed in $tokens.
     *
     * @return void
     */
Processes this test, when one of its tokens is encountered.
@param PHP_CodeSniffer_File $phpcsFile The file being scanned.
@param int                  $stackPtr  The position of the current token
in the stack passed in $tokens.

@return void
Processes this test when one of its tokens is encountered . @param PHP_CodeSniffer_File $phpcsFile The file being scanned . @param int $stackPtr The position of the current token in the stack passed in $tokens . @return void
public function process(File $phpcsFile, $stackPtr)
    {
        $tokens = $phpcsFile->getTokens();
        $find   = Tokens::$methodPrefixes;
        $find[] = T_WHITESPACE;
        $commentEnd = $phpcsFile->findPrevious($find, ($stackPtr - 1), null, true);
        if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG
            && $tokens[$commentEnd]['code'] !== T_COMMENT
        ) {
            $phpcsFile->addError('Missing class doc comment', $stackPtr, 'Missing');
            $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'no');
            return;
        }
        $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'yes');
        if ($tokens[$commentEnd]['code'] === T_COMMENT) {
            $phpcsFile->addError('You must use "/**" style comments for a class comment', $stackPtr, 'WrongStyle');
            return;
        }
        if ($tokens[$commentEnd]['line'] !== ($tokens[$stackPtr]['line'] - 1)) {
            $error = 'There must be no blank lines after the class comment';
            $phpcsFile->addError($error, $commentEnd, 'SpacingAfter');
        }
        $commentStart = $tokens[$commentEnd]['comment_opener'];
        foreach ($tokens[$commentStart]['comment_tags'] as $tag) {
            $error = '%s tag is not allowed in class comment';
            $data  = array($tokens[$tag]['content']);
            $phpcsFile->addWarning($error, $tag, 'TagNotAllowed', $data);
        }
    }
public function process ( File $ phpcsFile , $ stackPtr ) { $ tokens = $ phpcsFile -> getTokens ( ) ; $ find = Tokens :: $ methodPrefixes ; $ find [ ] = T_WHITESPACE ; $ commentEnd = $ phpcsFile -> findPrevious ( $ find , ( $ stackPtr - 1 ) , null , true ) ; if ( $ tokens [ $ commentEnd ] [ 'code' ] !== T_DOC_COMMENT_CLOSE_TAG && $ tokens [ $ commentEnd ] [ 'code' ] !== T_COMMENT ) { $ phpcsFile -> addError ( 'Missing class doc comment' , $ stackPtr , 'Missing' ) ; $ phpcsFile -> recordMetric ( $ stackPtr , 'Class has doc comment' , 'no' ) ; return ; } $ phpcsFile -> recordMetric ( $ stackPtr , 'Class has doc comment' , 'yes' ) ; if ( $ tokens [ $ commentEnd ] [ 'code' ] === T_COMMENT ) { $ phpcsFile -> addError ( 'You must use "/**" style comments for a class comment' , $ stackPtr , 'WrongStyle' ) ; return ; } if ( $ tokens [ $ commentEnd ] [ 'line' ] !== ( $ tokens [ $ stackPtr ] [ 'line' ] - 1 ) ) { $ error = 'There must be no blank lines after the class comment' ; $ phpcsFile -> addError ( $ error , $ commentEnd , 'SpacingAfter' ) ; } $ commentStart = $ tokens [ $ commentEnd ] [ 'comment_opener' ] ; foreach ( $ tokens [ $ commentStart ] [ 'comment_tags' ] as $ tag ) { $ error = '%s tag is not allowed in class comment' ; $ data = array ( $ tokens [ $ tag ] [ 'content' ] ) ; $ phpcsFile -> addWarning ( $ error , $ tag , 'TagNotAllowed' , $ data ) ; } }
Processes this test, when one of its tokens is encountered.
Processes this test when one of its tokens is encountered .