src/UriTemplates/Parsers/Lexers/TokenStream.php
public function next(): ?Token
    {
        return \count($this->tokens) > ++$this->cursor ? $this->tokens[$this->cursor] : null;
    }
public function next(): ?Token
    {
        return \count($this->tokens) > ++$this->cursor ? $this->tokens[$this->cursor] : null;
    }
Gets the next token, if there is one

@return Token|null The next token, if there is one, otherwise false