extensions/felixfbecker.php-intellisense-0.0.12/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/Channels/IncludeOwnSystemSniff.php
/**
     * Processes this sniff, 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 sniff, 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 sniff 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)
    {
        $fileName = $phpcsFile->getFilename();
        $matches  = array();
        if (preg_match('|/systems/(.*)/([^/]+)?actions.inc$|i', $fileName, $matches) === 0) {
            return;
        }
        $ownClass = $matches[2];
        $tokens   = $phpcsFile->getTokens();
        $typeName = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($stackPtr + 2), null, false, true);
        $typeName = trim($tokens[$typeName]['content'], " '");
        switch (strtolower($tokens[($stackPtr + 1)]['content'])) {
        case 'includesystem' :
            $included = strtolower($typeName);
            break;
        case 'includeasset' :
            $included = strtolower($typeName).'assettype';
            break;
        case 'includewidget' :
            $included = strtolower($typeName).'widgettype';
            break;
        default:
            return;
        }
        if ($included === strtolower($ownClass)) {
            $error = "You do not need to include \"%s\" from within the system's own actions file";
            $data  = array($ownClass);
            $phpcsFile->addError($error, $stackPtr, 'NotRequired', $data);
        }
    }
public function process ( File $ phpcsFile , $ stackPtr ) { $ fileName = $ phpcsFile -> getFilename ( ) ; $ matches = array ( ) ; if ( preg_match ( '|/systems/(.*)/([^/]+)?actions.inc$|i' , $ fileName , $ matches ) === 0 ) { return ; } $ ownClass = $ matches [ 2 ] ; $ tokens = $ phpcsFile -> getTokens ( ) ; $ typeName = $ phpcsFile -> findNext ( T_CONSTANT_ENCAPSED_STRING , ( $ stackPtr + 2 ) , null , false , true ) ; $ typeName = trim ( $ tokens [ $ typeName ] [ 'content' ] , "  ' " ) ; switch ( strtolower ( $ tokens [ ( $ stackPtr + 1 ) ] [ 'content' ] ) ) { case 'includesystem' : $ included = strtolower ( $ typeName ) ; break ; case 'includeasset' : $ included = strtolower ( $ typeName ) . 'assettype' ; break ; case 'includewidget' : $ included = strtolower ( $ typeName ) . 'widgettype' ; break ; default : return ; } if ( $ included === strtolower ( $ ownClass ) ) { $ error = " You do not need to include  \" %s \"  from within the system's own actions file " ; $ data = array ( $ ownClass ) ; $ phpcsFile -> addError ( $ error , $ stackPtr , 'NotRequired' , $ data ) ; } }
Processes this sniff, when one of its tokens is encountered.
Processes this sniff when one of its tokens is encountered .
// Not an actions file.