summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2019-08-11 22:20:26 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2019-08-11 22:21:08 +0200
commit3e80b136825516481f388ee41cf4716dff945ae3 (patch)
treebfdbb27bb8d4b2da7bb0361a98f196f9bb29bcc4
parent177981d80d98affc94b68be6142b02921506e456 (diff)
downloadphp-git-3e80b136825516481f388ee41cf4716dff945ae3.tar.gz
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.
-rw-r--r--ext/com_dotnet/com_com.c5
-rw-r--r--ext/com_dotnet/com_dotnet.c1
-rw-r--r--ext/com_dotnet/com_persist.c5
-rw-r--r--ext/com_dotnet/com_variant.c1
4 files changed, 1 insertions, 11 deletions
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c
index 15465d4956..a16d5396d8 100644
--- a/ext/com_dotnet/com_com.c
+++ b/ext/com_dotnet/com_com.c
@@ -60,12 +60,10 @@ PHP_FUNCTION(com_create_instance)
ZEND_NUM_ARGS(), "s|s!ls",
&module_name, &module_name_len, &server_name, &server_name_len,
&cp, &typelib_name, &typelib_name_len) &&
- FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
+ FAILURE == zend_parse_parameters(
ZEND_NUM_ARGS(), "sa|ls",
&module_name, &module_name_len, &server_params, &cp,
&typelib_name, &typelib_name_len)) {
-
- php_com_throw_exception(E_INVALIDARG, "Could not create COM object - invalid arguments!");
return;
}
@@ -302,7 +300,6 @@ PHP_FUNCTION(com_get_active_object)
php_com_initialize();
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|l",
&module_name, &module_name_len, &code_page)) {
- php_com_throw_exception(E_INVALIDARG, "Invalid arguments!");
return;
}
diff --git a/ext/com_dotnet/com_dotnet.c b/ext/com_dotnet/com_dotnet.c
index 7222615986..2904076f12 100644
--- a/ext/com_dotnet/com_dotnet.c
+++ b/ext/com_dotnet/com_dotnet.c
@@ -243,7 +243,6 @@ PHP_FUNCTION(com_dotnet_create_instance)
&assembly_name, &assembly_name_len,
&datatype_name, &datatype_name_len,
&cp)) {
- php_com_throw_exception(E_INVALIDARG, "Could not create .Net object - invalid arguments!");
return;
}
diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c
index 97810ec8cc..03b5dd09c8 100644
--- a/ext/com_dotnet/com_persist.c
+++ b/ext/com_dotnet/com_persist.c
@@ -382,7 +382,6 @@ CPH_METHOD(SaveToFile)
if (helper->ipf) {
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "p!|b",
&filename, &filename_len, &remember)) {
- php_com_throw_exception(E_INVALIDARG, "Invalid arguments");
return;
}
@@ -446,7 +445,6 @@ CPH_METHOD(LoadFromFile)
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "p|l",
&filename, &filename_len, &flags)) {
- php_com_throw_exception(E_INVALIDARG, "Invalid arguments");
return;
}
@@ -542,7 +540,6 @@ CPH_METHOD(LoadFromStream)
CPH_FETCH();
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zstm)) {
- php_com_throw_exception(E_INVALIDARG, "invalid arguments");
return;
}
@@ -604,7 +601,6 @@ CPH_METHOD(SaveToStream)
CPH_NO_OBJ();
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zstm)) {
- php_com_throw_exception(E_INVALIDARG, "invalid arguments");
return;
}
@@ -652,7 +648,6 @@ CPH_METHOD(__construct)
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|O!",
&zobj, php_com_variant_class_entry)) {
- php_com_throw_exception(E_INVALIDARG, "invalid arguments");
return;
}
diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c
index aef7fabe7f..64a14666fc 100644
--- a/ext/com_dotnet/com_variant.c
+++ b/ext/com_dotnet/com_variant.c
@@ -452,7 +452,6 @@ PHP_FUNCTION(com_variant_create_instance)
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
"z!|ll", &zvalue, &vt, &codepage)) {
- php_com_throw_exception(E_INVALIDARG, "Invalid arguments");
return;
}