public static function fromString(string $json): ?self
    {
        $document = \json_decode($json, true);

        if (JSON_ERROR_NONE !== \json_last_error() || !\is_array($document)) {
            return null;
        }

        return new self($document);
    }