From 4d6781a9c4140a8561062b66a584f88d284e6d34 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Mon, 15 Jul 2024 16:05:55 +0200 Subject: [PATCH] PHPC-2349, PHPC-2411: Deprecate unused exception classes (#1608) * PHPC-2349: Deprecate WriteException class * PHPC-2411: Deprecate SSLConnectionException --- src/MongoDB/Exception/SSLConnectionException.stub.php | 1 + src/MongoDB/Exception/SSLConnectionException_arginfo.h | 4 ++-- src/MongoDB/Exception/WriteException.stub.php | 1 + src/MongoDB/Exception/WriteException_arginfo.h | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/MongoDB/Exception/SSLConnectionException.stub.php b/src/MongoDB/Exception/SSLConnectionException.stub.php index 5401b8844..0c6ae5446 100644 --- a/src/MongoDB/Exception/SSLConnectionException.stub.php +++ b/src/MongoDB/Exception/SSLConnectionException.stub.php @@ -7,6 +7,7 @@ namespace MongoDB\Driver\Exception; +/** @deprecated use ConnectionException instead */ final class SSLConnectionException extends ConnectionException { } diff --git a/src/MongoDB/Exception/SSLConnectionException_arginfo.h b/src/MongoDB/Exception/SSLConnectionException_arginfo.h index 668f79829..16098231a 100644 --- a/src/MongoDB/Exception/SSLConnectionException_arginfo.h +++ b/src/MongoDB/Exception/SSLConnectionException_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 95855dc37941494d4bb81c28077c1fa79153d027 */ + * Stub hash: 2948889569c0558ad634e3d05360b9d942dbb282 */ @@ -14,7 +14,7 @@ static zend_class_entry *register_class_MongoDB_Driver_Exception_SSLConnectionEx INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver\\Exception", "SSLConnectionException", class_MongoDB_Driver_Exception_SSLConnectionException_methods); class_entry = zend_register_internal_class_ex(&ce, class_entry_MongoDB_Driver_Exception_ConnectionException); - class_entry->ce_flags |= ZEND_ACC_FINAL; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_DEPRECATED; return class_entry; } 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..9c3e9f43d 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,7 +19,7 @@ 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);