Skip to content

Commit 3e80b13

Browse files
committed
Don't throw manual exceptions on ZPP failure
As of PHP 8.0.0, ZPP throws on failure, so manually throwing exceptions is superfluous and confusing.
1 parent 177981d commit 3e80b13

File tree

4 files changed

+1
-11
lines changed

4 files changed

+1
-11
lines changed

ext/com_dotnet/com_com.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,10 @@ PHP_FUNCTION(com_create_instance)
6060
ZEND_NUM_ARGS(), "s|s!ls",
6161
&module_name, &module_name_len, &server_name, &server_name_len,
6262
&cp, &typelib_name, &typelib_name_len) &&
63-
FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
63+
FAILURE == zend_parse_parameters(
6464
ZEND_NUM_ARGS(), "sa|ls",
6565
&module_name, &module_name_len, &server_params, &cp,
6666
&typelib_name, &typelib_name_len)) {
67-
68-
php_com_throw_exception(E_INVALIDARG, "Could not create COM object - invalid arguments!");
6967
return;
7068
}
7169

@@ -302,7 +300,6 @@ PHP_FUNCTION(com_get_active_object)
302300
php_com_initialize();
303301
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|l",
304302
&module_name, &module_name_len, &code_page)) {
305-
php_com_throw_exception(E_INVALIDARG, "Invalid arguments!");
306303
return;
307304
}
308305

ext/com_dotnet/com_dotnet.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ PHP_FUNCTION(com_dotnet_create_instance)
243243
&assembly_name, &assembly_name_len,
244244
&datatype_name, &datatype_name_len,
245245
&cp)) {
246-
php_com_throw_exception(E_INVALIDARG, "Could not create .Net object - invalid arguments!");
247246
return;
248247
}
249248

ext/com_dotnet/com_persist.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,6 @@ CPH_METHOD(SaveToFile)
382382
if (helper->ipf) {
383383
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "p!|b",
384384
&filename, &filename_len, &remember)) {
385-
php_com_throw_exception(E_INVALIDARG, "Invalid arguments");
386385
return;
387386
}
388387

@@ -446,7 +445,6 @@ CPH_METHOD(LoadFromFile)
446445

447446
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "p|l",
448447
&filename, &filename_len, &flags)) {
449-
php_com_throw_exception(E_INVALIDARG, "Invalid arguments");
450448
return;
451449
}
452450

@@ -542,7 +540,6 @@ CPH_METHOD(LoadFromStream)
542540
CPH_FETCH();
543541

544542
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zstm)) {
545-
php_com_throw_exception(E_INVALIDARG, "invalid arguments");
546543
return;
547544
}
548545

@@ -604,7 +601,6 @@ CPH_METHOD(SaveToStream)
604601
CPH_NO_OBJ();
605602

606603
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zstm)) {
607-
php_com_throw_exception(E_INVALIDARG, "invalid arguments");
608604
return;
609605
}
610606

@@ -652,7 +648,6 @@ CPH_METHOD(__construct)
652648

653649
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|O!",
654650
&zobj, php_com_variant_class_entry)) {
655-
php_com_throw_exception(E_INVALIDARG, "invalid arguments");
656651
return;
657652
}
658653

ext/com_dotnet/com_variant.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,6 @@ PHP_FUNCTION(com_variant_create_instance)
452452

453453
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
454454
"z!|ll", &zvalue, &vt, &codepage)) {
455-
php_com_throw_exception(E_INVALIDARG, "Invalid arguments");
456455
return;
457456
}
458457

0 commit comments

Comments
 (0)