lib/Aegis/Parser.php
public function expect(int $type, $value = null) : bool
    {
        if (!$this->accept($type, $value)) {
            $this->syntaxError('Expected '.Token::getStringRepresentation($type, $value).' got '.$this->getCurrentToken());
        }

        return true;
    }
public function expect(int $type, $value = null) : bool
    {
        if (!$this->accept($type, $value)) {
            $this->syntaxError('Expected '.Token::getStringRepresentation($type, $value).' got '.$this->getCurrentToken());
        }

        return true;
    }
public function expect ( int $ type , $ value = null ) : bool { if ( ! $ this -> accept ( $ type , $ value ) ) { $ this -> syntaxError ( 'Expected ' . Token :: getStringRepresentation ( $ type , $ value ) . ' got ' . $ this -> getCurrentToken ( ) ) ; } return true ; }
Expects the current token to be of given type and optionally has given value

@param int $type
@param null $value
@return bool
@throws ParseError
Expects the current token to be of given type and optionally has given value