lib/Aegis/Parser.php
public function accept(int $type, $value = null) : bool
    {
        if ($this->getCurrentToken()->getType() === $type) {
            if ($value) {
                if ($this->getCurrentToken()->getValue() === $value) {
                    return true;
                }

                return false;
            }

            return true;
        }

        return false;
    }
public function accept(int $type, $value = null) : bool
    {
        if ($this->getCurrentToken()->getType() === $type) {
            if ($value) {
                if ($this->getCurrentToken()->getValue() === $value) {
                    return true;
                }

                return false;
            }

            return true;
        }

        return false;
    }
public function accept ( int $ type , $ value = null ) : bool { if ( $ this -> getCurrentToken ( ) -> getType ( ) === $ type ) { if ( $ value ) { if ( $ this -> getCurrentToken ( ) -> getValue ( ) === $ value ) { return true ; } return false ; } return true ; } return false ; }
Accepts the current token if it's of given type and optionally has given value

@param int $type
@param null $value
@return bool
Accepts the current token if it s of given type and optionally has given value