src/Token/TokenType.php
private function protect()
    {
        if (!in_array($this->type, self::allAsString(), true)) {
            throw new \InvalidArgumentException(sprintf('Invalid token type "%s"', $this->type));
        }
    }
private function protect()
    {
        if (!in_array($this->type, self::allAsString(), true)) {
            throw new \InvalidArgumentException(sprintf('Invalid token type "%s"', $this->type));
        }
    }
private function protect ( ) { if ( ! in_array ( $ this -> type , self :: allAsString ( ) , true ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Invalid token type "%s"' , $ this -> type ) ) ; } }
Check if the tokenType exists in our list
Check if the tokenType exists in our list