public function serialize()
    {
        if ($this->getHandler() instanceof Closure) {
            throw new LogicException('Cannot serialize handler.');
        }

        return serialize(array_combine(static::$keys, array_map(function ($key) {
            return call_user_func([$this, 'get'.ucfirst($key)]);
        }, static::$keys)));
    }