]> granicus.if.org Git - php/commitdiff
Don't throw manual exceptions on ZPP failure
authorChristoph M. Becker <cmbecker69@gmx.de>
Sun, 11 Aug 2019 20:20:26 +0000 (22:20 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Sun, 11 Aug 2019 20:21:08 +0000 (22:21 +0200)
As of PHP 8.0.0, ZPP throws on failure, so manually throwing exceptions
is superfluous and confusing.

ext/com_dotnet/com_com.c
ext/com_dotnet/com_dotnet.c
ext/com_dotnet/com_persist.c
ext/com_dotnet/com_variant.c

index 15465d49569cf0eabe3a6a2588c6a4a4abdc1a8a..a16d5396d8d900da447fa44f97a94fc84af06235 100644 (file)
@@ -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;
        }
 
index 7222615986b8da0ac04007afabe3f98868d13c48..2904076f126c1566eaf3993a40efc586f8dd08d9 100644 (file)
@@ -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;
        }
 
index 97810ec8cc9ff9bb78ced72b8ed73fce4d0e88aa..03b5dd09c82dde9ff1d818a3fa24348c76f941dc 100644 (file)
@@ -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;
        }
 
index aef7fabe7f414169bf638692ee89288a5855ca1f..64a14666fc23378ca33d61591f924d5a220f27c1 100644 (file)
@@ -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;
        }