extensions/felixfbecker.php-intellisense-0.0.12/vendor/squizlabs/php_codesniffer/src/Files/File.php
/**
     * Returns the position of the first token on a line, matching given type.
     *
     * Returns false if no token can be found.
     *
     * @param int|array $types   The type(s) of tokens to search for.
     * @param int       $start   The position to start searching from in the
     *                           token stack. The first token matching on
     *                           this line before this token will be returned.
     * @param bool      $exclude If true, find the token that is NOT of
     *                           the types specified in $types.
     * @param string    $value   The value that the token must be equal to.
     *                           If value is omitted, tokens with any value will
     *                           be returned.
     *
     * @return int | bool
     */
Returns the position of the first token on a line, matching given type.
Returns false if no token can be found.

@param int|array $types   The type(s) of tokens to search for.
@param int       $start   The position to start searching from in the
token stack. The first token matching on
this line before this token will be returned.
@param bool      $exclude If true, find the token that is NOT of
the types specified in $types.
@param string    $value   The value that the token must be equal to.
If value is omitted, tokens with any value will
be returned.

@return int | bool
Returns the position of the first token on a line matching given type . Returns false if no token can be found . @param int|array $types The type ( s ) of tokens to search for . @param int $start The position to start searching from in the token stack . The first token matching on this line before this token will be returned . @param bool $exclude If true find the token that is NOT of the types specified in $types . @param string $value The value that the token must be equal to . If value is omitted tokens with any value will be returned . @return int | bool
public function findFirstOnLine($types, $start, $exclude=false, $value=null)
    {
        if (is_array($types) === false) {
            $types = array($types);
        }
        $foundToken = false;
        for ($i = $start; $i >= 0; $i--) {
            if ($this->tokens[$i]['line'] < $this->tokens[$start]['line']) {
                break;
            }
            $found = $exclude;
            foreach ($types as $type) {
                if ($exclude === false) {
                    if ($this->tokens[$i]['code'] === $type) {
                        $found = true;
                        break;
                    }
                } else {
                    if ($this->tokens[$i]['code'] === $type) {
                        $found = false;
                        break;
                    }
                }
            }
            if ($found === true) {
                if ($value === null) {
                    $foundToken = $i;
                } else if ($this->tokens[$i]['content'] === $value) {
                    $foundToken = $i;
                }
            }
        }
        return $foundToken;
    }
public function findFirstOnLine ( $ types , $ start , $ exclude = false , $ value = null ) { if ( is_array ( $ types ) === false ) { $ types = array ( $ types ) ; } $ foundToken = false ; for ( $ i = $ start ; $ i >= 0 ; $ i -- ) { if ( $ this -> tokens [ $ i ] [ 'line' ] < $ this -> tokens [ $ start ] [ 'line' ] ) { break ; } $ found = $ exclude ; foreach ( $ types as $ type ) { if ( $ exclude === false ) { if ( $ this -> tokens [ $ i ] [ 'code' ] === $ type ) { $ found = true ; break ; } } else { if ( $ this -> tokens [ $ i ] [ 'code' ] === $ type ) { $ found = false ; break ; } } } if ( $ found === true ) { if ( $ value === null ) { $ foundToken = $ i ; } else if ( $ this -> tokens [ $ i ] [ 'content' ] === $ value ) { $ foundToken = $ i ; } } } return $ foundToken ; }
Returns the position of the first token on a line, matching given type.
Returns the position of the first token on a line matching given type .
//end for