public/phpmyadmin/vendor/squizlabs/php_codesniffer/src/Files/File.php
/**
     * Returns the position of the previous specified token(s).
     *
     * If a value is specified, the previous token of the specified type(s)
     * containing the specified value will be returned.
     *
     * 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.
     * @param int       $end     The end position to fail if no token is found.
     *                           if not specified or null, end will default to
     *                           the start of the token stack.
     * @param bool      $exclude If true, find the previous token that is NOT of
     *                           the types specified in $types.
     * @param string    $value   The value that the token(s) must be equal to.
     *                           If value is omitted, tokens with any value will
     *                           be returned.
     * @param bool      $local   If true, tokens outside the current statement
     *                           will not be checked. IE. checking will stop
     *                           at the previous semi-colon found.
     *
     * @return int|bool
     * @see    findNext()
     */
Returns the position of the previous specified token(s).
If a value is specified, the previous token of the specified type(s)
containing the specified value will be returned.

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.
@param int       $end     The end position to fail if no token is found.
if not specified or null, end will default to
the start of the token stack.
@param bool      $exclude If true, find the previous token that is NOT of
the types specified in $types.
@param string    $value   The value that the token(s) must be equal to.
If value is omitted, tokens with any value will
be returned.
@param bool      $local   If true, tokens outside the current statement
will not be checked. IE. checking will stop
at the previous semi-colon found.

@return int|bool
@see    findNext()
Returns the position of the previous specified token ( s ) . If a value is specified the previous token of the specified type ( s ) containing the specified value will be returned . 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 . @param int $end The end position to fail if no token is found . if not specified or null end will default to the start of the token stack . @param bool $exclude If true find the previous token that is NOT of the types specified in $types . @param string $value The value that the token ( s ) must be equal to . If value is omitted tokens with any value will be returned . @param bool $local If true tokens outside the current statement will not be checked . IE . checking will stop at the previous semi - colon found . @return int|bool @see findNext ()
public function findPrevious(
        $types,
        $start,
        $end=null,
        $exclude=false,
        $value=null,
        $local=false
    ) {
        $types = (array) $types;
        if ($end === null) {
            $end = 0;
        }
        for ($i = $start; $i >= $end; $i--) {
            $found = (bool) $exclude;
            foreach ($types as $type) {
                if ($this->tokens[$i]['code'] === $type) {
                    $found = !$exclude;
                    break;
                }
            }
            if ($found === true) {
                if ($value === null) {
                    return $i;
                } else if ($this->tokens[$i]['content'] === $value) {
                    return $i;
                }
            }
            if ($local === true) {
                if (isset($this->tokens[$i]['scope_opener']) === true
                    && $i === $this->tokens[$i]['scope_closer']
                ) {
                    $i = $this->tokens[$i]['scope_opener'];
                } else if (isset($this->tokens[$i]['bracket_opener']) === true
                    && $i === $this->tokens[$i]['bracket_closer']
                ) {
                    $i = $this->tokens[$i]['bracket_opener'];
                } else if (isset($this->tokens[$i]['parenthesis_opener']) === true
                    && $i === $this->tokens[$i]['parenthesis_closer']
                ) {
                    $i = $this->tokens[$i]['parenthesis_opener'];
                } else if ($this->tokens[$i]['code'] === T_SEMICOLON) {
                    break;
                }
            }
        }
        return false;
    }
public function findPrevious ( $ types , $ start , $ end = null , $ exclude = false , $ value = null , $ local = false ) { $ types = ( array ) $ types ; if ( $ end === null ) { $ end = 0 ; } for ( $ i = $ start ; $ i >= $ end ; $ i -- ) { $ found = ( bool ) $ exclude ; foreach ( $ types as $ type ) { if ( $ this -> tokens [ $ i ] [ 'code' ] === $ type ) { $ found = ! $ exclude ; break ; } } if ( $ found === true ) { if ( $ value === null ) { return $ i ; } else if ( $ this -> tokens [ $ i ] [ 'content' ] === $ value ) { return $ i ; } } if ( $ local === true ) { if ( isset ( $ this -> tokens [ $ i ] [ 'scope_opener' ] ) === true && $ i === $ this -> tokens [ $ i ] [ 'scope_closer' ] ) { $ i = $ this -> tokens [ $ i ] [ 'scope_opener' ] ; } else if ( isset ( $ this -> tokens [ $ i ] [ 'bracket_opener' ] ) === true && $ i === $ this -> tokens [ $ i ] [ 'bracket_closer' ] ) { $ i = $ this -> tokens [ $ i ] [ 'bracket_opener' ] ; } else if ( isset ( $ this -> tokens [ $ i ] [ 'parenthesis_opener' ] ) === true && $ i === $ this -> tokens [ $ i ] [ 'parenthesis_closer' ] ) { $ i = $ this -> tokens [ $ i ] [ 'parenthesis_opener' ] ; } else if ( $ this -> tokens [ $ i ] [ 'code' ] === T_SEMICOLON ) { break ; } } } return false ; }
Returns the position of the previous specified token(s).
Returns the position of the previous specified token ( s ) .
//end for