@@ -67,12 +67,12 @@ PHP_METHOD(WriteConcernError, getCode)
67
67
RETURN_LONG (intern -> code );
68
68
}
69
69
/* }}} */
70
- /* {{{ proto array WriteConcernError::getInfo()
70
+ /* {{{ proto mixed WriteConcernError::getInfo()
71
71
Returns additional metadata for the error */
72
72
PHP_METHOD (WriteConcernError , getInfo )
73
73
{
74
74
php_phongo_writeconcernerror_t * intern ;
75
- zend_error_handling error_handling ;
75
+ zend_error_handling error_handling ;
76
76
77
77
78
78
zend_replace_error_handling (EH_THROW , phongo_exception_from_phongo_domain (PHONGO_ERROR_INVALID_ARGUMENT ), & error_handling TSRMLS_CC );
@@ -85,11 +85,9 @@ PHP_METHOD(WriteConcernError, getInfo)
85
85
zend_restore_error_handling (& error_handling TSRMLS_CC );
86
86
87
87
88
- if (intern -> info && Z_TYPE_P ( intern -> info ) == IS_ARRAY ) {
88
+ if (intern -> info ) {
89
89
RETURN_ZVAL (intern -> info , 1 , 0 );
90
90
}
91
-
92
- array_init (return_value );
93
91
}
94
92
/* }}} */
95
93
/* {{{ proto string WriteConcernError::getMessage()
@@ -183,8 +181,12 @@ HashTable *php_phongo_writeconcernerror_get_debug_info(zval *object, int *is_tem
183
181
array_init_size (& retval , 3 );
184
182
add_assoc_string_ex (& retval , ZEND_STRS ("message" ), intern -> message , 1 );
185
183
add_assoc_long_ex (& retval , ZEND_STRS ("code" ), intern -> code );
186
- Z_ADDREF_P (intern -> info );
187
- add_assoc_zval_ex (& retval , ZEND_STRS ("info" ), intern -> info );
184
+ if (intern -> info ) {
185
+ Z_ADDREF_P (intern -> info );
186
+ add_assoc_zval_ex (& retval , ZEND_STRS ("info" ), intern -> info );
187
+ } else {
188
+ add_assoc_null_ex (& retval , ZEND_STRS ("info" ));
189
+ }
188
190
189
191
return Z_ARRVAL (retval );
190
192
} /* }}} */
0 commit comments