protected static function readObject($object): string
    {
        if ($object instanceof Closure) {
            return 'Function';
        }

        if ($object instanceof DateTime) {
            return sprintf('DateTime(%s)', $object->format('Y-m-d\TH:i:sP'));
        }

        if (method_exists($object, 'toString')) {
            return (string) $object->toString();
        }

        if (method_exists($object, '__toString')) {
            return (string) $object;
        }

        return sprintf('Object(%s)', get_class($object));
    }