If the lookahead token type matches the given type, move to the next token.

@param int $type

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

        $this->next();
        return true;
    }
1317758
public function moveToNextByNodeType($nodeType)
    {
        if (null === self::valid()) {
            self::rewind();
        } elseif (self::valid()) {
            self::next();
        }

        while (self::valid()) {
            if ($this->reader->nodeType === $nodeType) {
                break;
            }
            self::next();
        }

        return self::valid() ? self::current() : false;
    }
366568
private function validateToken($type)
    {
        $token = $this->lexer->token;

        if ($token['type'] !== $type) {
            throw new \InvalidArgumentException(sprintf(
                'Expected a token type "%d", got "%d".',
                TypeLexer::T_LOWER_THAN,
                $token['type']
            ));
        }

        $this->walk();

        return $token;
    }
809493
protected function expectTokenType($type)
    {
        $types = (array) $type;
        if (in_array($this->predictTokenType(), $types)) {
            return $this->lexer->getAdvancedToken();
        }

        $token = $this->lexer->predictToken();

        throw new ParserException(sprintf(
            'Expected %s token, but got %s on line: %d%s',
            implode(' or ', $types),
            $this->predictTokenType(),
            $token['line'],
            $this->file ? ' in file: ' . $this->file : ''
        ));
    }
961338
public static function isValidType($type)
    {
        if ($type === '') {
            $result = true;
        } else {
            $valid = self::getTypesInfo();
            $result = isset($valid[$type]);
        }

        return $result;
    }
1283059
public function hasType( string $type ): bool
	{
		if( substr($type, 0, 2) !== "#/" )
		{
			$type = "#/{$type}";
		}
		return $this->getType() === $type;
	}
280786
public function match($token)
    {
        $lookaheadType = $this->lexer->lookahead['type'];

        // Short-circuit on first condition, usually types match
        if ($lookaheadType === $token) {
            $this->lexer->moveNext();

            return;
        }

        // If parameter is not identifier (1-99) must be exact match
        if ($token < Lexer::T_IDENTIFIER) {
            $this->syntaxError($this->lexer->getLiteral($token));
        }

        // If parameter is keyword (200+) must be exact match
        if ($token > Lexer::T_IDENTIFIER) {
            $this->syntaxError($this->lexer->getLiteral($token));
        }

        // If parameter is T_IDENTIFIER, then matches T_IDENTIFIER (100) and keywords (200+)
        if ($token === Lexer::T_IDENTIFIER && $lookaheadType < Lexer::T_IDENTIFIER) {
            $this->syntaxError($this->lexer->getLiteral($token));
        }

        $this->lexer->moveNext();
    }
295492
protected function skip($type)
    {
        if ($match = ($this->token->getType() === $type)) {
            $this->advance();
        }

        return $match;
    }
1321607
public function is($type)
    {
        $myMimetype = $this->getMimetype();

        if (strpos($type, '/')) {
            return strtolower($myMimetype) == strtolower($type);
        }

        $prefix = strtolower(explode('/', $myMimetype)[0]);

        return strtolower($type) == $prefix;
    }
533912
public function hasFinder($type)
    {
        $finder = 'find' . $type;

        return method_exists($this, $finder) || ($this->_behaviors && $this->_behaviors->hasFinder($type));
    }
212504
public function prevTypeIsAnyOf(array $types): bool
    {
        return isset($this->tokens[$this->position - 2]) && $this->tokens[$this->position - 2]->typeEqualsAnyOf($types);
    }
106893
public function has($type)
    {
        if (!isset($this->checkers[$type])) {
            return false;
        }

        return $this->container->has($this->checkers[$type]);
    }
1008349
public function skipUntil($type) {
    while (!$this->isToken($type) && $this->hasNext()) {
      $this->moveNext();
    }

    return $this;
  }
736295
public function acceptType($type) {
        if ( ! isset($this->claim->accept_types) ) return false;
        if ( ! is_array($this->claim->accept_types) ) return false;
        return in_array($type, $this->claim->accept_types);
    }
207563
public function hasType(NodeType $type)
    {
        foreach ($this->types as $t) {
            if ($t->getId() == $type->getId()) { return true; }
        }

        return false;
    }
572716
public function matchesMediaType(string $mediaType): bool
    {
        foreach ($this->mediaTypePatterns as $mediaTypePattern) {
            if ($mediaTypePattern->matches($mediaType)) {
                return true;
            }
        }
        return false;
    }
1049235
protected function matchAny(array $types)
    {
        if ( ! $this->lexer->isNextAny($types)) {
            $this->syntaxError('any of '.implode(' or ', array_map(array($this->lexer, 'getName'), $types)));
        }

        $this->lexer->moveNext();

        return $this->lexer->token[0];
    }