src/TokenStream.php
public function nextIfLookahead(int $type): bool
    {
        if (!isset($this->tokens[$this->position]) || !$this->tokens[$this->position]->typeEquals($type)) {
            return false;
        }

        $this->next();
        return true;
    }
public function nextIfLookahead(int $type): bool
    {
        if (!isset($this->tokens[$this->position]) || !$this->tokens[$this->position]->typeEquals($type)) {
            return false;
        }

        $this->next();
        return true;
    }
public function nextIfLookahead ( int $ type ) : bool { if ( ! isset ( $ this -> tokens [ $ this -> position ] ) || ! $ this -> tokens [ $ this -> position ] -> typeEquals ( $ type ) ) { return false ; } $ this -> next ( ) ; return true ; }
If the lookahead token type matches the given type, move to the next token.

@param int $type

@return bool
If the lookahead token type matches the given type move to the next token .