public function getToken($offset = null, array $default = null)
    {
        if (null === $offset) {
            $offset = $this->offset;
        }

        if (isset($this->tokens[$offset])) {
            if (!isset($this->tokens[$offset][0])) {
                throw InvalidTokenException::create(
                    'Token #%d is missing its token identifier.',
                    $offset
                );
            }

            if (!isset(self::$valid[$this->tokens[$offset][0]])) {
                throw InvalidTokenException::create(
                    'Token #%d does not have a valid token identifier.',
                    $offset
                );
            }

            if ((isset(self::$hasValue[$this->tokens[$offset][0]]))
                && !isset($this->tokens[$offset][1])) {
                throw InvalidTokenException::create(
                    'Token #%d (%d) is missing its value.',
                    $offset,
                    $this->tokens[$offset][0]
                );
            }

            return $this->tokens[$offset];
        }

        return $default;
    }