From 8600ab869218300cdbd2827e7f0c05aedc9bf529 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 10 Jul 2024 15:30:08 +0200 Subject: [PATCH] PHPC-2349: Deprecate WriteException class --- src/MongoDB/Exception/WriteException.stub.php | 1 + src/MongoDB/Exception/WriteException_arginfo.h | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/MongoDB/Exception/WriteException.stub.php b/src/MongoDB/Exception/WriteException.stub.php index dc95a78b2..4372e933a 100644 --- a/src/MongoDB/Exception/WriteException.stub.php +++ b/src/MongoDB/Exception/WriteException.stub.php @@ -7,6 +7,7 @@ namespace MongoDB\Driver\Exception; +/** @deprecated use MongoDB\Driver\Exception\BulkWriteException instead */ abstract class WriteException extends RuntimeException { /** @var \MongoDB\Driver\WriteResult */ diff --git a/src/MongoDB/Exception/WriteException_arginfo.h b/src/MongoDB/Exception/WriteException_arginfo.h index 2692bac03..5ce6480fc 100644 --- a/src/MongoDB/Exception/WriteException_arginfo.h +++ b/src/MongoDB/Exception/WriteException_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 93ac52bdf35d69310a30f335be70489ba52edd51 */ + * Stub hash: bf7229dbad041a8fe73af62d1961700783a933e3 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_MongoDB_Driver_Exception_WriteException_getWriteResult, 0, 0, MongoDB\\Driver\\WriteResult, 0) ZEND_END_ARG_INFO() @@ -19,12 +19,12 @@ static zend_class_entry *register_class_MongoDB_Driver_Exception_WriteException( INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver\\Exception", "WriteException", class_MongoDB_Driver_Exception_WriteException_methods); class_entry = zend_register_internal_class_ex(&ce, class_entry_MongoDB_Driver_Exception_RuntimeException); - class_entry->ce_flags |= ZEND_ACC_ABSTRACT; + class_entry->ce_flags |= ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED; zval property_writeResult_default_value; ZVAL_NULL(&property_writeResult_default_value); zend_string *property_writeResult_name = zend_string_init("writeResult", sizeof("writeResult") - 1, 1); - zend_declare_property_ex(class_entry, property_writeResult_name, &property_writeResult_default_value, ZEND_ACC_PROTECTED, NULL); + zend_declare_typed_property(class_entry, property_writeResult_name, &property_writeResult_default_value, ZEND_ACC_PROTECTED, NULL, (zend_type) ZEND_TYPE_INIT_NONE(0)); zend_string_release(property_writeResult_name); return class_entry;