public function encode($data, int $options = null): string
    {
        if ($options !== null) {
            return (clone $this)->encode($data);
        }

        return $this->wrap(function () use ($data) {
            return @\json_encode($data, $this->getOptions(), $this->getRecursionDepth());
        });
    }