extensions/felixfbecker.php-intellisense-0.0.12/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php
/**
     * Processes the tokens that this sniff is interested in.
     *
     * @param PHP_CodeSniffer_File $phpcsFile The file where the token was found.
     * @param int                  $stackPtr  The position in the stack where
     *                                        the token was found.
     *
     * @return void
     * @throws PHP_CodeSniffer_Exception If jslint.js could not be run
     */
Processes the tokens that this sniff is interested in.
@param PHP_CodeSniffer_File $phpcsFile The file where the token was found.
@param int                  $stackPtr  The position in the stack where
the token was found.

@return void
@throws PHP_CodeSniffer_Exception If jslint.js could not be run
Processes the tokens that this sniff is interested in . @param PHP_CodeSniffer_File $phpcsFile The file where the token was found . @param int $stackPtr The position in the stack where the token was found . @return void @throws PHP_CodeSniffer_Exception If jslint . js could not be run
public function process(File $phpcsFile, $stackPtr)
    {
        $rhinoPath  = Config::getExecutablePath('jslint');
        $jslintPath = Config::getExecutablePath('jslint');
        if ($rhinoPath === null || $jslintPath === null) {
            return;
        }
        $fileName = $phpcsFile->getFilename();
        $cmd = "$rhinoPath \"$jslintPath\" \"$fileName\"";
        $msg = exec($cmd, $output, $retval);
        if (is_array($output) === true) {
            foreach ($output as $finding) {
                $matches    = array();
                $numMatches = preg_match('/Lint at line ([0-9]+).*:(.*)$/', $finding, $matches);
                if ($numMatches === 0) {
                    continue;
                }
                $line    = (int) $matches[1];
                $message = 'jslint says: '.trim($matches[2]);
                $phpcsFile->addWarningOnLine($message, $line, 'ExternalTool');
            }
        }
        return ($phpcsFile->numTokens + 1);
    }
public function process ( File $ phpcsFile , $ stackPtr ) { $ rhinoPath = Config :: getExecutablePath ( 'jslint' ) ; $ jslintPath = Config :: getExecutablePath ( 'jslint' ) ; if ( $ rhinoPath === null || $ jslintPath === null ) { return ; } $ fileName = $ phpcsFile -> getFilename ( ) ; $ cmd = " $ rhinoPath \" $ jslintPath \" \" $ fileName \" " ; $ msg = exec ( $ cmd , $ output , $ retval ) ; if ( is_array ( $ output ) === true ) { foreach ( $ output as $ finding ) { $ matches = array ( ) ; $ numMatches = preg_match ( '/Lint at line ([0-9]+).*:(.*)$/' , $ finding , $ matches ) ; if ( $ numMatches === 0 ) { continue ; } $ line = ( int ) $ matches [ 1 ] ; $ message = 'jslint says: ' . trim ( $ matches [ 2 ] ) ; $ phpcsFile -> addWarningOnLine ( $ message , $ line , 'ExternalTool' ) ; } } return ( $ phpcsFile -> numTokens + 1 ) ; }
Processes the tokens that this sniff is interested in.
Processes the tokens that this sniff is interested in .
// Ignore the rest of the file.