extensions/felixfbecker.php-intellisense-0.0.12/vendor/squizlabs/php_codesniffer/src/Files/File.php
/**
     * Returns the position of the first non-whitespace token in a statement.
     *
     * @param int       $start  The position to start searching from in the token stack.
     * @param int|array $ignore Token types that should not be considered stop points.
     *
     * @return int
     */
Returns the position of the first non-whitespace token in a statement.
@param int       $start  The position to start searching from in the token stack.
@param int|array $ignore Token types that should not be considered stop points.

@return int
Returns the position of the first non - whitespace token in a statement . @param int $start The position to start searching from in the token stack . @param int|array $ignore Token types that should not be considered stop points . @return int
public function findStartOfStatement($start, $ignore=null)
    {
        $endTokens = Util\Tokens::$blockOpeners;
        $endTokens[T_COLON]            = true;
        $endTokens[T_COMMA]            = true;
        $endTokens[T_DOUBLE_ARROW]     = true;
        $endTokens[T_SEMICOLON]        = true;
        $endTokens[T_OPEN_TAG]         = true;
        $endTokens[T_CLOSE_TAG]        = true;
        $endTokens[T_OPEN_SHORT_ARRAY] = true;
        if ($ignore !== null) {
            $ignore = (array) $ignore;
            foreach ($ignore as $code) {
                if (isset($endTokens[$code]) === true) {
                    unset($endTokens[$code]);
                }
            }
        }
        $lastNotEmpty = $start;
        for ($i = $start; $i >= 0; $i--) {
            if (isset($endTokens[$this->tokens[$i]['code']]) === true) {
                return $lastNotEmpty;
            }
            if (isset($this->tokens[$i]['scope_opener']) === true
                && $i === $this->tokens[$i]['scope_closer']
            ) {
                return $lastNotEmpty;
            }
            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'];
            }
            if (isset(Util\Tokens::$emptyTokens[$this->tokens[$i]['code']]) === false) {
                $lastNotEmpty = $i;
            }
        }
        return 0;
    }
public function findStartOfStatement ( $ start , $ ignore = null ) { $ endTokens = Util \ Tokens :: $ blockOpeners ; $ endTokens [ T_COLON ] = true ; $ endTokens [ T_COMMA ] = true ; $ endTokens [ T_DOUBLE_ARROW ] = true ; $ endTokens [ T_SEMICOLON ] = true ; $ endTokens [ T_OPEN_TAG ] = true ; $ endTokens [ T_CLOSE_TAG ] = true ; $ endTokens [ T_OPEN_SHORT_ARRAY ] = true ; if ( $ ignore !== null ) { $ ignore = ( array ) $ ignore ; foreach ( $ ignore as $ code ) { if ( isset ( $ endTokens [ $ code ] ) === true ) { unset ( $ endTokens [ $ code ] ) ; } } } $ lastNotEmpty = $ start ; for ( $ i = $ start ; $ i >= 0 ; $ i -- ) { if ( isset ( $ endTokens [ $ this -> tokens [ $ i ] [ 'code' ] ] ) === true ) { return $ lastNotEmpty ; } if ( isset ( $ this -> tokens [ $ i ] [ 'scope_opener' ] ) === true && $ i === $ this -> tokens [ $ i ] [ 'scope_closer' ] ) { return $ lastNotEmpty ; } 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' ] ; } if ( isset ( Util \ Tokens :: $ emptyTokens [ $ this -> tokens [ $ i ] [ 'code' ] ] ) === false ) { $ lastNotEmpty = $ i ; } } return 0 ; }
Returns the position of the first non-whitespace token in a statement.
Returns the position of the first non - whitespace token in a statement .
// Found the end of the previous statement. // Found the end of the previous scope block. // Skip nested statements. //end for