extensions/felixfbecker.php-intellisense-0.0.12/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Operators/ValidLogicalOperatorsSniff.php
/**
     * Processes this test, when one of its tokens is encountered.
     *
     * @param PHP_CodeSniffer_File $phpcsFile The current 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 current 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 current 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();
        $replacements = array(
                         'and' => '&&',
                         'or'  => '||',
                        );
        $operator = strtolower($tokens[$stackPtr]['content']);
        if (isset($replacements[$operator]) === false) {
            return;
        }
        $error = 'Logical operator "%s" is prohibited; use "%s" instead';
        $data  = array(
                  $operator,
                  $replacements[$operator],
                 );
        $phpcsFile->addError($error, $stackPtr, 'NotAllowed', $data);
    }
public function process ( File $ phpcsFile , $ stackPtr ) { $ tokens = $ phpcsFile -> getTokens ( ) ; $ replacements = array ( 'and' => '&&' , 'or' => '||' , ) ; $ operator = strtolower ( $ tokens [ $ stackPtr ] [ 'content' ] ) ; if ( isset ( $ replacements [ $ operator ] ) === false ) { return ; } $ error = 'Logical operator "%s" is prohibited; use "%s" instead' ; $ data = array ( $ operator , $ replacements [ $ operator ] , ) ; $ phpcsFile -> addError ( $ error , $ stackPtr , 'NotAllowed' , $ data ) ; }
Processes this test, when one of its tokens is encountered.
Processes this test when one of its tokens is encountered .