From aa696d2ba43bd93ac7b1d6690e4840ec5f874d46 Mon Sep 17 00:00:00 2001 From: Nikita Gusakov Date: Sat, 26 Jul 2014 13:11:39 +0400 Subject: [PATCH] Added missing tests for deprecated modifier #462 --- ext/config.m4 | 2 + ext/test.c | 4 + ext/test.h | 2 + ext/test/bench/foo.zep.c | 3 +- ext/test/branchprediction.zep.c | 4 +- ext/test/compare.zep.c | 6 +- ext/test/factorial.zep.c | 8 +- ext/test/fcall.zep.c | 4 +- ext/test/fibonnaci.zep.c | 34 +++-- ext/test/flow.zep.c | 6 +- ext/test/mcall.zep.c | 24 ++-- ext/test/mcallchained.zep.c | 9 +- ext/test/oo/deprecatedmethods.zep.c | 52 ++++++++ ext/test/oo/deprecatedmethods.zep.h | 15 +++ ext/test/operator.zep.c | 38 ++++++ ext/test/operator.zep.h | 16 +++ ext/test/router.zep.c | 2 +- ext/test/spectralnorm.zep.c | 119 +++++++++-------- ext/test/trytest.zep.c | 120 ++++++++++-------- test/oo/DeprecatedMethods.zep | 19 +++ .../Extension/Oo/DeprecatedMethodsTest.php | 43 +++++++ 21 files changed, 359 insertions(+), 171 deletions(-) create mode 100644 ext/test/oo/deprecatedmethods.zep.c create mode 100644 ext/test/oo/deprecatedmethods.zep.h create mode 100644 ext/test/operator.zep.c create mode 100644 ext/test/operator.zep.h create mode 100644 test/oo/DeprecatedMethods.zep create mode 100644 unit-tests/Extension/Oo/DeprecatedMethodsTest.php diff --git a/ext/config.m4 b/ext/config.m4 index bdf9ee4d51..5ef14916cc 100644 --- a/ext/config.m4 +++ b/ext/config.m4 @@ -49,6 +49,7 @@ if test "$PHP_TEST" = "yes"; then test/nativearray.zep.c test/oo.zep.c test/oo/abstractclass.zep.c + test/oo/deprecatedmethods.zep.c test/oo/constantsinterface.zep.c test/oo/dynamicprop.zep.c test/oo/extendpdoclass.zep.c @@ -60,6 +61,7 @@ if test "$PHP_TEST" = "yes"; then test/oo/oonoconstruct.zep.c test/oo/ooparams.zep.c test/oo/propertyaccess.zep.c + test/operator.zep.c test/pdostatement.zep.c test/pregmatch.zep.c test/properties/extendspublicproperties.zep.c diff --git a/ext/test.c b/ext/test.c index d309de826e..104682fa5b 100644 --- a/ext/test.c +++ b/ext/test.c @@ -76,6 +76,7 @@ zend_class_entry *test_nativearray_ce; zend_class_entry *test_oo_abstractclass_ce; zend_class_entry *test_oo_ce; zend_class_entry *test_oo_constantsinterface_ce; +zend_class_entry *test_oo_deprecatedmethods_ce; zend_class_entry *test_oo_dynamicprop_ce; zend_class_entry *test_oo_extendpdoclass_ce; zend_class_entry *test_oo_ooconstruct_ce; @@ -85,6 +86,7 @@ zend_class_entry *test_oo_oonativeimplements_ce; zend_class_entry *test_oo_oonoconstruct_ce; zend_class_entry *test_oo_ooparams_ce; zend_class_entry *test_oo_propertyaccess_ce; +zend_class_entry *test_operator_ce; zend_class_entry *test_pdostatement_ce; zend_class_entry *test_pregmatch_ce; zend_class_entry *test_properties_extendspublicproperties_ce; @@ -330,6 +332,7 @@ static PHP_MINIT_FUNCTION(test) ZEPHIR_INIT(Test_Oo); ZEPHIR_INIT(Test_Oo_AbstractClass); ZEPHIR_INIT(Test_Oo_ConstantsInterface); + ZEPHIR_INIT(Test_Oo_DeprecatedMethods); ZEPHIR_INIT(Test_Oo_DynamicProp); ZEPHIR_INIT(Test_Oo_ExtendPdoClass); ZEPHIR_INIT(Test_Oo_OoConstruct); @@ -339,6 +342,7 @@ static PHP_MINIT_FUNCTION(test) ZEPHIR_INIT(Test_Oo_OoNoConstruct); ZEPHIR_INIT(Test_Oo_OoParams); ZEPHIR_INIT(Test_Oo_PropertyAccess); + ZEPHIR_INIT(Test_Operator); ZEPHIR_INIT(Test_PdoStatement); ZEPHIR_INIT(Test_Pregmatch); ZEPHIR_INIT(Test_Properties_ExtendsPublicProperties); diff --git a/ext/test.h b/ext/test.h index a383d45216..1a74e8d564 100644 --- a/ext/test.h +++ b/ext/test.h @@ -51,6 +51,7 @@ #include "test/nativearray.zep.h" #include "test/oo.zep.h" #include "test/oo/abstractclass.zep.h" +#include "test/oo/deprecatedmethods.zep.h" #include "test/oo/constantsinterface.zep.h" #include "test/oo/dynamicprop.zep.h" #include "test/oo/extendpdoclass.zep.h" @@ -62,6 +63,7 @@ #include "test/oo/oonoconstruct.zep.h" #include "test/oo/ooparams.zep.h" #include "test/oo/propertyaccess.zep.h" +#include "test/operator.zep.h" #include "test/pdostatement.zep.h" #include "test/pregmatch.zep.h" #include "test/properties/extendspublicproperties.zep.h" diff --git a/ext/test/bench/foo.zep.c b/ext/test/bench/foo.zep.c index a2ee289ce3..13635aa5a6 100644 --- a/ext/test/bench/foo.zep.c +++ b/ext/test/bench/foo.zep.c @@ -503,7 +503,6 @@ PHP_METHOD(Test_Bench_Foo, g) { PHP_METHOD(Test_Bench_Foo, call) { - zephir_fcall_cache_entry *_3 = NULL; int _1, ZEPHIR_LAST_CALL_STATUS; zend_bool _0; zval *n, *i = NULL, *_2 = NULL; @@ -528,7 +527,7 @@ PHP_METHOD(Test_Bench_Foo, call) { } ZEPHIR_INIT_NVAR(i); ZVAL_LONG(i, _1); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "g", &_3); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "g", NULL); zephir_check_call_status(); } } diff --git a/ext/test/branchprediction.zep.c b/ext/test/branchprediction.zep.c index 9e67bf4032..a5dee1c296 100644 --- a/ext/test/branchprediction.zep.c +++ b/ext/test/branchprediction.zep.c @@ -46,7 +46,7 @@ PHP_METHOD(Test_BranchPrediction, testLikely2) { - if (likely(ZEPHIR_IS_LONG(a, 1))) { + if (likely(ZEPHIR_IS_LONG_IDENTICAL(a, 1))) { RETURN_BOOL(1); } else { RETURN_BOOL(0); @@ -73,7 +73,7 @@ PHP_METHOD(Test_BranchPrediction, testUnlikely2) { - if (likely(ZEPHIR_IS_LONG(a, 1))) { + if (likely(ZEPHIR_IS_LONG_IDENTICAL(a, 1))) { RETURN_BOOL(1); } else { RETURN_BOOL(0); diff --git a/ext/test/compare.zep.c b/ext/test/compare.zep.c index c46ceeb6ac..1c3d5e0b73 100644 --- a/ext/test/compare.zep.c +++ b/ext/test/compare.zep.c @@ -111,15 +111,15 @@ PHP_METHOD(Test_Compare, testVarWithStringEquals) { ZEPHIR_SEPARATE_PARAM(str); - if (ZEPHIR_IS_STRING(str, "wrong testing")) { + if (ZEPHIR_IS_STRING_IDENTICAL(str, "wrong testing")) { ZEPHIR_INIT_NVAR(str); ZVAL_STRING(str, "NOK", 1); } else { - if (ZEPHIR_IS_STRING(str, "another testing")) { + if (ZEPHIR_IS_STRING_IDENTICAL(str, "another testing")) { ZEPHIR_INIT_NVAR(str); ZVAL_STRING(str, "NOK", 1); } else { - if (ZEPHIR_IS_STRING(str, "testing")) { + if (ZEPHIR_IS_STRING_IDENTICAL(str, "testing")) { ZEPHIR_INIT_NVAR(str); ZVAL_STRING(str, "OK", 1); } else { diff --git a/ext/test/factorial.zep.c b/ext/test/factorial.zep.c index f077a7fdaf..2dfd1fdc2a 100644 --- a/ext/test/factorial.zep.c +++ b/ext/test/factorial.zep.c @@ -61,7 +61,7 @@ PHP_METHOD(Test_Factorial, intIterativeFactorial) { PHP_METHOD(Test_Factorial, intRecursiveFactorial) { zend_bool _1; - zval *num_param = NULL, *_0, *_2 = NULL, _3; + zval *num_param = NULL, *_0, *_2 = NULL, *_3; int num, ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); @@ -78,9 +78,9 @@ PHP_METHOD(Test_Factorial, intRecursiveFactorial) { if (_1) { ZVAL_LONG(_0, 1); } else { - ZEPHIR_SINIT_VAR(_3); - ZVAL_LONG(&_3, (num - 1)); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "intrecursivefactorial", NULL, &_3); + ZEPHIR_INIT_VAR(_3); + ZVAL_LONG(_3, (num - 1)); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "intrecursivefactorial", NULL, _3); zephir_check_call_status(); ZVAL_LONG(_0, (num * zephir_get_numberval(_2))); } diff --git a/ext/test/fcall.zep.c b/ext/test/fcall.zep.c index b711d2da1b..985a5d5bed 100644 --- a/ext/test/fcall.zep.c +++ b/ext/test/fcall.zep.c @@ -90,7 +90,7 @@ PHP_METHOD(Test_Fcall, testCall3) { ZVAL_LONG(&_0, 4096); ZEPHIR_CALL_FUNCTION(&buffer, "fgets", &_3, handle, &_0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE(buffer)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(buffer)) { break; } zephir_fwrite(NULL, handle2, buffer TSRMLS_CC); @@ -128,7 +128,7 @@ PHP_METHOD(Test_Fcall, testCall4) { ZVAL_LONG(&_0, 4096); ZEPHIR_CALL_FUNCTION(&buffer, "fgets", &_3, handle, &_0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE(buffer)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(buffer)) { break; } zephir_fwrite(NULL, handle2, buffer TSRMLS_CC); diff --git a/ext/test/fibonnaci.zep.c b/ext/test/fibonnaci.zep.c index e00bb0cd76..1354d8133c 100644 --- a/ext/test/fibonnaci.zep.c +++ b/ext/test/fibonnaci.zep.c @@ -136,8 +136,7 @@ PHP_METHOD(Test_Fibonnaci, fibArray2) { PHP_METHOD(Test_Fibonnaci, fibonacciRecursive) { - zephir_nts_static zephir_fcall_cache_entry *_2 = NULL; - zval *n_param = NULL, *_0 = NULL, _1 = zval_used_for_init, *_3 = NULL; + zval *n_param = NULL, *_0 = NULL, *_1 = NULL, *_2 = NULL; int n, ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); @@ -152,15 +151,15 @@ PHP_METHOD(Test_Fibonnaci, fibonacciRecursive) { if (n == 1) { RETURN_MM_LONG(1); } else { - ZEPHIR_SINIT_VAR(_1); - ZVAL_LONG(&_1, (n - 1)); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "fibonaccirecursive", &_2, &_1); + ZEPHIR_INIT_VAR(_1); + ZVAL_LONG(_1, (n - 1)); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "fibonaccirecursive", NULL, _1); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_1); - ZVAL_LONG(&_1, (n - 2)); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "fibonaccirecursive", &_2, &_1); + ZEPHIR_INIT_NVAR(_1); + ZVAL_LONG(_1, (n - 2)); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "fibonaccirecursive", NULL, _1); zephir_check_call_status(); - zephir_add_function(return_value, _0, _3 TSRMLS_CC); + zephir_add_function(return_value, _0, _2 TSRMLS_CC); RETURN_MM(); } } @@ -169,8 +168,7 @@ PHP_METHOD(Test_Fibonnaci, fibonacciRecursive) { PHP_METHOD(Test_Fibonnaci, fibonacciFinalRecursive) { - zephir_nts_static zephir_fcall_cache_entry *_2 = NULL; - zval *n_param = NULL, *_0 = NULL, _1 = zval_used_for_init, *_3 = NULL; + zval *n_param = NULL, *_0 = NULL, *_1 = NULL, *_2 = NULL; int n, ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); @@ -185,15 +183,15 @@ PHP_METHOD(Test_Fibonnaci, fibonacciFinalRecursive) { if (n == 1) { RETURN_MM_LONG(1); } else { - ZEPHIR_SINIT_VAR(_1); - ZVAL_LONG(&_1, (n - 1)); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "fibonaccifinalrecursive", &_2, &_1); + ZEPHIR_INIT_VAR(_1); + ZVAL_LONG(_1, (n - 1)); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "fibonaccifinalrecursive", NULL, _1); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_1); - ZVAL_LONG(&_1, (n - 2)); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "fibonaccifinalrecursive", &_2, &_1); + ZEPHIR_INIT_NVAR(_1); + ZVAL_LONG(_1, (n - 2)); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "fibonaccifinalrecursive", NULL, _1); zephir_check_call_status(); - zephir_add_function(return_value, _0, _3 TSRMLS_CC); + zephir_add_function(return_value, _0, _2 TSRMLS_CC); RETURN_MM(); } } diff --git a/ext/test/flow.zep.c b/ext/test/flow.zep.c index 227a56f3ec..2687b4f415 100644 --- a/ext/test/flow.zep.c +++ b/ext/test/flow.zep.c @@ -1653,7 +1653,6 @@ PHP_METHOD(Test_Flow, testFor35Aux) { PHP_METHOD(Test_Flow, testFor35) { - zephir_fcall_cache_entry *_4 = NULL; int _1, _2, ZEPHIR_LAST_CALL_STATUS; zend_bool _0; zval *i = NULL, *_3 = NULL; @@ -1677,7 +1676,7 @@ PHP_METHOD(Test_Flow, testFor35) { ZVAL_LONG(i, _1); ZEPHIR_INIT_NVAR(_3); ZVAL_STRING(_3, "hello", 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "testfor35aux", &_4, _3); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "testfor35aux", NULL, _3); zephir_check_temp_parameter(_3); zephir_check_call_status(); } @@ -1702,7 +1701,6 @@ PHP_METHOD(Test_Flow, testFor36Aux) { PHP_METHOD(Test_Flow, testFor36) { - zephir_fcall_cache_entry *_4 = NULL; int _1, _2, ZEPHIR_LAST_CALL_STATUS; zend_bool _0; zval *i = NULL, *_3 = NULL; @@ -1726,7 +1724,7 @@ PHP_METHOD(Test_Flow, testFor36) { ZVAL_LONG(i, _1); ZEPHIR_INIT_NVAR(_3); ZVAL_STRING(_3, "hello", 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "testfor36aux", &_4, _3); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "testfor36aux", NULL, _3); zephir_check_temp_parameter(_3); zephir_check_call_status(); } diff --git a/ext/test/mcall.zep.c b/ext/test/mcall.zep.c index 29b603ca72..4131408c86 100644 --- a/ext/test/mcall.zep.c +++ b/ext/test/mcall.zep.c @@ -124,12 +124,11 @@ PHP_METHOD(Test_Mcall, testCall2) { PHP_METHOD(Test_Mcall, testCall3) { - zephir_nts_static zephir_fcall_cache_entry *_0 = NULL; int ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "testmethod3", &_0); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "testmethod3", NULL); zephir_check_call_status(); RETURN_MM(); @@ -169,7 +168,6 @@ PHP_METHOD(Test_Mcall, testCall5) { PHP_METHOD(Test_Mcall, testCall6) { - zephir_nts_static zephir_fcall_cache_entry *_0 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *a, *b; @@ -178,7 +176,7 @@ PHP_METHOD(Test_Mcall, testCall6) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "testmethod6", &_0, a, b); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "testmethod6", NULL, a, b); zephir_check_call_status(); RETURN_MM(); @@ -224,20 +222,19 @@ PHP_METHOD(Test_Mcall, testCall8) { PHP_METHOD(Test_Mcall, testCall9) { - zephir_nts_static zephir_fcall_cache_entry *_1 = NULL; int ZEPHIR_LAST_CALL_STATUS; - zval *a, *b, *_0 = NULL, *_2 = NULL; + zval *a, *b, *_0 = NULL, *_1 = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &a, &b); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "testmethod6", &_1, a, b); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "testmethod6", NULL, a, b); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "testmethod5", NULL, a, b); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "testmethod5", NULL, a, b); zephir_check_call_status(); - zephir_add_function(return_value, _0, _2 TSRMLS_CC); + zephir_add_function(return_value, _0, _1 TSRMLS_CC); RETURN_MM(); } @@ -360,12 +357,11 @@ PHP_METHOD(Test_Mcall, testCall17) { PHP_METHOD(Test_Mcall, testCall18) { - zephir_nts_static zephir_fcall_cache_entry *_0 = NULL; int ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "testmethod7", &_0); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "testmethod7", NULL); zephir_check_call_status(); RETURN_MM(); @@ -388,7 +384,6 @@ PHP_METHOD(Test_Mcall, testMethod19) { PHP_METHOD(Test_Mcall, testCall20) { - zephir_fcall_cache_entry *_4 = NULL; int _1, ZEPHIR_LAST_CALL_STATUS; zend_bool _0; zval *k_param = NULL, *p, *_3 = NULL; @@ -414,7 +409,7 @@ PHP_METHOD(Test_Mcall, testCall20) { _0 = 1; } i = _1; - ZEPHIR_CALL_METHOD(&_3, this_ptr, "testmethod19", &_4, p, p); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "testmethod19", NULL, p, p); zephir_check_call_status(); j += zephir_get_numberval(_3); } @@ -440,7 +435,6 @@ PHP_METHOD(Test_Mcall, testMethod21) { PHP_METHOD(Test_Mcall, testCall22) { - zephir_nts_static zephir_fcall_cache_entry *_4 = NULL; int _1, ZEPHIR_LAST_CALL_STATUS; zend_bool _0; zval *k_param = NULL, *p, *_3 = NULL; @@ -466,7 +460,7 @@ PHP_METHOD(Test_Mcall, testCall22) { _0 = 1; } i = _1; - ZEPHIR_CALL_METHOD(&_3, this_ptr, "testmethod21", &_4, p, p); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "testmethod21", NULL, p, p); zephir_check_call_status(); j += zephir_get_numberval(_3); } diff --git a/ext/test/mcallchained.zep.c b/ext/test/mcallchained.zep.c index 481af0bbbb..31ce180fd1 100644 --- a/ext/test/mcallchained.zep.c +++ b/ext/test/mcallchained.zep.c @@ -85,17 +85,16 @@ PHP_METHOD(Test_McallChained, testChained2) { PHP_METHOD(Test_McallChained, testChained3) { - zephir_nts_static zephir_fcall_cache_entry *_1 = NULL; int ZEPHIR_LAST_CALL_STATUS; - zval *_0 = NULL, *_2 = NULL; + zval *_0 = NULL, *_1 = NULL; ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "testmethod3", &_1); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "testmethod3", NULL); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_2, _0, "testmethod2", NULL); + ZEPHIR_CALL_METHOD(&_1, _0, "testmethod2", NULL); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(_2, "testmethod1", NULL); + ZEPHIR_RETURN_CALL_METHOD(_1, "testmethod1", NULL); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/test/oo/deprecatedmethods.zep.c b/ext/test/oo/deprecatedmethods.zep.c new file mode 100644 index 0000000000..95d887102b --- /dev/null +++ b/ext/test/oo/deprecatedmethods.zep.c @@ -0,0 +1,52 @@ + +#ifdef HAVE_CONFIG_H +#include "../../ext_config.h" +#endif + +#include +#include "../../php_ext.h" +#include "../../ext.h" + +#include +#include +#include + +#include "kernel/main.h" +#include "kernel/fcall.h" +#include "kernel/memory.h" + + +ZEPHIR_INIT_CLASS(Test_Oo_DeprecatedMethods) { + + ZEPHIR_REGISTER_CLASS(Test\\Oo, DeprecatedMethods, test, oo_deprecatedmethods, test_oo_deprecatedmethods_method_entry, 0); + + return SUCCESS; + +} + +PHP_METHOD(Test_Oo_DeprecatedMethods, deprecatedMethod) { + + + RETURN_BOOL(1); + +} + +PHP_METHOD(Test_Oo_DeprecatedMethods, normalMethod) { + + int ZEPHIR_LAST_CALL_STATUS; + + ZEPHIR_MM_GROW(); + + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "privatedepricatedmethod", NULL); + zephir_check_call_status(); + RETURN_MM(); + +} + +PHP_METHOD(Test_Oo_DeprecatedMethods, privateDepricatedMethod) { + + + RETURN_BOOL(1); + +} + diff --git a/ext/test/oo/deprecatedmethods.zep.h b/ext/test/oo/deprecatedmethods.zep.h new file mode 100644 index 0000000000..7fa19deabe --- /dev/null +++ b/ext/test/oo/deprecatedmethods.zep.h @@ -0,0 +1,15 @@ + +extern zend_class_entry *test_oo_deprecatedmethods_ce; + +ZEPHIR_INIT_CLASS(Test_Oo_DeprecatedMethods); + +PHP_METHOD(Test_Oo_DeprecatedMethods, deprecatedMethod); +PHP_METHOD(Test_Oo_DeprecatedMethods, normalMethod); +PHP_METHOD(Test_Oo_DeprecatedMethods, privateDepricatedMethod); + +ZEPHIR_INIT_FUNCS(test_oo_deprecatedmethods_method_entry) { + PHP_ME(Test_Oo_DeprecatedMethods, deprecatedMethod, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED) + PHP_ME(Test_Oo_DeprecatedMethods, normalMethod, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Test_Oo_DeprecatedMethods, privateDepricatedMethod, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_DEPRECATED) + PHP_FE_END +}; diff --git a/ext/test/operator.zep.c b/ext/test/operator.zep.c new file mode 100644 index 0000000000..e4b45a5ef3 --- /dev/null +++ b/ext/test/operator.zep.c @@ -0,0 +1,38 @@ + +#ifdef HAVE_CONFIG_H +#include "../ext_config.h" +#endif + +#include +#include "../php_ext.h" +#include "../ext.h" + +#include +#include +#include + +#include "kernel/main.h" +#include "kernel/operators.h" +#include "kernel/memory.h" + + +ZEPHIR_INIT_CLASS(Test_Operator) { + + ZEPHIR_REGISTER_CLASS(Test, Operator, test, operator, test_operator_method_entry, 0); + + return SUCCESS; + +} + +PHP_METHOD(Test_Operator, testIdentical) { + + zval *param1, *param2; + + zephir_fetch_params(0, 2, 0, ¶m1, ¶m2); + + + + RETURN_BOOL(ZEPHIR_IS_IDENTICAL(param1, param2)); + +} + diff --git a/ext/test/operator.zep.h b/ext/test/operator.zep.h new file mode 100644 index 0000000000..b5c7665ec4 --- /dev/null +++ b/ext/test/operator.zep.h @@ -0,0 +1,16 @@ + +extern zend_class_entry *test_operator_ce; + +ZEPHIR_INIT_CLASS(Test_Operator); + +PHP_METHOD(Test_Operator, testIdentical); + +ZEND_BEGIN_ARG_INFO_EX(arginfo_test_operator_testidentical, 0, 0, 2) + ZEND_ARG_INFO(0, param1) + ZEND_ARG_INFO(0, param2) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(test_operator_method_entry) { + PHP_ME(Test_Operator, testIdentical, arginfo_test_operator_testidentical, ZEND_ACC_PUBLIC) + PHP_FE_END +}; diff --git a/ext/test/router.zep.c b/ext/test/router.zep.c index a764f6392b..9f476fd589 100644 --- a/ext/test/router.zep.c +++ b/ext/test/router.zep.c @@ -484,7 +484,7 @@ PHP_METHOD(Test_Router, handle) { } ZEPHIR_CALL_METHOD(&_7, request, "ismethod", NULL, methods); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE(_7)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(_7)) { continue; } } diff --git a/ext/test/spectralnorm.zep.c b/ext/test/spectralnorm.zep.c index 10b42d1e35..620512ce9a 100644 --- a/ext/test/spectralnorm.zep.c +++ b/ext/test/spectralnorm.zep.c @@ -52,10 +52,9 @@ PHP_METHOD(Test_SpectralNorm, Ax) { PHP_METHOD(Test_SpectralNorm, Au) { - zephir_fcall_cache_entry *_11 = NULL, *_13 = NULL; - zephir_nts_static zephir_fcall_cache_entry *_9 = NULL; + zephir_fcall_cache_entry *_10 = NULL, *_12 = NULL; zend_bool _0, _3; - zval *n_param = NULL, *u, *v, *_6 = NULL, *_7 = NULL, *_8 = NULL, *_10 = NULL, *_12 = NULL; + zval *n_param = NULL, *u, *v, *_6 = NULL, *_7 = NULL, *_8 = NULL, *_9 = NULL, *_11 = NULL; int n, t, i, j, _1, _2, _4, _5, ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); @@ -105,22 +104,22 @@ PHP_METHOD(Test_SpectralNorm, Au) { ZVAL_LONG(_7, i); ZEPHIR_INIT_NVAR(_8); ZVAL_LONG(_8, j); - ZEPHIR_CALL_METHOD(&_6, this_ptr, "ax", &_9, _7, _8); + ZEPHIR_CALL_METHOD(&_6, this_ptr, "ax", NULL, _7, _8); zephir_check_call_status(); ZEPHIR_INIT_NVAR(_7); ZVAL_LONG(_7, j); - ZEPHIR_CALL_METHOD(&_10, u, "offsetget", &_11, _7); + ZEPHIR_CALL_METHOD(&_9, u, "offsetget", &_10, _7); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_12); - mul_function(_12, _6, _10 TSRMLS_CC); - t += zephir_get_numberval(_12); + ZEPHIR_INIT_LNVAR(_11); + mul_function(_11, _6, _9 TSRMLS_CC); + t += zephir_get_numberval(_11); } } ZEPHIR_INIT_NVAR(_7); ZVAL_LONG(_7, i); ZEPHIR_INIT_NVAR(_8); ZVAL_LONG(_8, t); - ZEPHIR_CALL_METHOD(NULL, v, "offsetset", &_13, _7, _8); + ZEPHIR_CALL_METHOD(NULL, v, "offsetset", &_12, _7, _8); zephir_check_call_status(); } } @@ -130,10 +129,9 @@ PHP_METHOD(Test_SpectralNorm, Au) { PHP_METHOD(Test_SpectralNorm, Atu) { - zephir_fcall_cache_entry *_11 = NULL, *_13 = NULL; - zephir_nts_static zephir_fcall_cache_entry *_9 = NULL; + zephir_fcall_cache_entry *_10 = NULL, *_12 = NULL; zend_bool _0, _3; - zval *n_param = NULL, *u, *v, *_6 = NULL, *_7 = NULL, *_8 = NULL, *_10 = NULL, *_12 = NULL; + zval *n_param = NULL, *u, *v, *_6 = NULL, *_7 = NULL, *_8 = NULL, *_9 = NULL, *_11 = NULL; int n, t, i, j, _1, _2, _4, _5, ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); @@ -183,22 +181,22 @@ PHP_METHOD(Test_SpectralNorm, Atu) { ZVAL_LONG(_7, j); ZEPHIR_INIT_NVAR(_8); ZVAL_LONG(_8, i); - ZEPHIR_CALL_METHOD(&_6, this_ptr, "ax", &_9, _7, _8); + ZEPHIR_CALL_METHOD(&_6, this_ptr, "ax", NULL, _7, _8); zephir_check_call_status(); ZEPHIR_INIT_NVAR(_7); ZVAL_LONG(_7, j); - ZEPHIR_CALL_METHOD(&_10, u, "offsetget", &_11, _7); + ZEPHIR_CALL_METHOD(&_9, u, "offsetget", &_10, _7); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_12); - mul_function(_12, _6, _10 TSRMLS_CC); - t += zephir_get_numberval(_12); + ZEPHIR_INIT_LNVAR(_11); + mul_function(_11, _6, _9 TSRMLS_CC); + t += zephir_get_numberval(_11); } } ZEPHIR_INIT_NVAR(_7); ZVAL_LONG(_7, i); ZEPHIR_INIT_NVAR(_8); ZVAL_LONG(_8, t); - ZEPHIR_CALL_METHOD(NULL, v, "offsetset", &_13, _7, _8); + ZEPHIR_CALL_METHOD(NULL, v, "offsetset", &_12, _7, _8); zephir_check_call_status(); } } @@ -208,7 +206,6 @@ PHP_METHOD(Test_SpectralNorm, Atu) { PHP_METHOD(Test_SpectralNorm, AtAu) { - zephir_nts_static zephir_fcall_cache_entry *_0 = NULL, *_1 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *n, *u, *v, *w; @@ -217,9 +214,9 @@ PHP_METHOD(Test_SpectralNorm, AtAu) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "au", &_0, n, u, w); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "au", NULL, n, u, w); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "atu", &_1, n, w, v); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "atu", NULL, n, w, v); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -227,11 +224,11 @@ PHP_METHOD(Test_SpectralNorm, AtAu) { PHP_METHOD(Test_SpectralNorm, process) { - zephir_nts_static zephir_fcall_cache_entry *_11 = NULL, *_24 = NULL; - zephir_fcall_cache_entry *_5 = NULL, *_6 = NULL, *_7 = NULL, *_16 = NULL, *_18 = NULL, *_20 = NULL, *_21 = NULL; - zend_bool _1, _8, _12; - zval *n_param = NULL, *u, *v, *w, *_0 = NULL, *_4 = NULL, *_15 = NULL, *_17 = NULL, *_19 = NULL, *_22 = NULL, _23; - int n, i, vv = 0, vBv = 0, ZEPHIR_LAST_CALL_STATUS, _2, _3, _9, _10, _13, _14; + zephir_nts_static zephir_fcall_cache_entry *_18 = NULL; + zephir_fcall_cache_entry *_5 = NULL, *_13 = NULL; + zend_bool _1, _6, _9; + zval *n_param = NULL, *u, *v, *w, *_0 = NULL, *_4 = NULL, *_12 = NULL, *_14 = NULL, *_15 = NULL, *_16 = NULL, _17; + int n, i, vv = 0, vBv = 0, ZEPHIR_LAST_CALL_STATUS, _2, _3, _7, _8, _10, _11; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &n_param); @@ -281,81 +278,81 @@ PHP_METHOD(Test_SpectralNorm, process) { ZVAL_LONG(_0, i); ZEPHIR_INIT_NVAR(_4); ZVAL_LONG(_4, 1); - ZEPHIR_CALL_METHOD(NULL, v, "offsetset", &_6, _0, _4); + ZEPHIR_CALL_METHOD(NULL, v, "offsetset", &_5, _0, _4); zephir_check_call_status(); ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, i); ZEPHIR_INIT_NVAR(_4); ZVAL_LONG(_4, 1); - ZEPHIR_CALL_METHOD(NULL, w, "offsetset", &_7, _0, _4); + ZEPHIR_CALL_METHOD(NULL, w, "offsetset", &_5, _0, _4); zephir_check_call_status(); } } - _10 = 9; - _9 = 0; - _8 = 0; - if (_9 <= _10) { + _8 = 9; + _7 = 0; + _6 = 0; + if (_7 <= _8) { while (1) { - if (_8) { - _9++; - if (!(_9 <= _10)) { + if (_6) { + _7++; + if (!(_7 <= _8)) { break; } } else { - _8 = 1; + _6 = 1; } - i = _9; + i = _7; ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, n); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "atau", &_11, _0, u, v, w); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "atau", NULL, _0, u, v, w); zephir_check_call_status(); ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, n); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "atau", &_11, _0, v, u, w); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "atau", NULL, _0, v, u, w); zephir_check_call_status(); } } - _14 = (n - 1); - _13 = 0; - _12 = 0; - if (_13 <= _14) { + _11 = (n - 1); + _10 = 0; + _9 = 0; + if (_10 <= _11) { while (1) { - if (_12) { - _13++; - if (!(_13 <= _14)) { + if (_9) { + _10++; + if (!(_10 <= _11)) { break; } } else { - _12 = 1; + _9 = 1; } - i = _13; + i = _10; ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, i); - ZEPHIR_CALL_METHOD(&_15, u, "offsetget", &_16, _0); + ZEPHIR_CALL_METHOD(&_12, u, "offsetget", &_13, _0); zephir_check_call_status(); ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, i); - ZEPHIR_CALL_METHOD(&_17, v, "offsetget", &_18, _0); + ZEPHIR_CALL_METHOD(&_14, v, "offsetget", &_13, _0); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_19); - mul_function(_19, _15, _17 TSRMLS_CC); - vBv += zephir_get_numberval(_19); + ZEPHIR_INIT_LNVAR(_15); + mul_function(_15, _12, _14 TSRMLS_CC); + vBv += zephir_get_numberval(_15); ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, i); - ZEPHIR_CALL_METHOD(&_15, v, "offsetget", &_20, _0); + ZEPHIR_CALL_METHOD(&_12, v, "offsetget", &_13, _0); zephir_check_call_status(); ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, i); - ZEPHIR_CALL_METHOD(&_17, v, "offsetget", &_21, _0); + ZEPHIR_CALL_METHOD(&_14, v, "offsetget", &_13, _0); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_22); - mul_function(_22, _15, _17 TSRMLS_CC); - vv += zephir_get_numberval(_22); + ZEPHIR_INIT_LNVAR(_16); + mul_function(_16, _12, _14 TSRMLS_CC); + vv += zephir_get_numberval(_16); } } - ZEPHIR_SINIT_VAR(_23); - ZVAL_LONG(&_23, (vBv / vv)); - ZEPHIR_RETURN_CALL_FUNCTION("sqrt", &_24, &_23); + ZEPHIR_SINIT_VAR(_17); + ZVAL_LONG(&_17, (vBv / vv)); + ZEPHIR_RETURN_CALL_FUNCTION("sqrt", &_18, &_17); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/test/trytest.zep.c b/ext/test/trytest.zep.c index 0a260b5316..d46fed79e9 100644 --- a/ext/test/trytest.zep.c +++ b/ext/test/trytest.zep.c @@ -117,11 +117,13 @@ PHP_METHOD(Test_TryTest, testTry3) { try_end_1: - ZEPHIR_INIT_NVAR(_1); - ZEPHIR_CPY_WRT(_1, EG(exception)); - if (zephir_instance_of_ev(_1, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { - zend_clear_exception(TSRMLS_C); - RETURN_MM_STRING("error", 1); + if (EG(exception)) { + ZEPHIR_INIT_NVAR(_1); + ZEPHIR_CPY_WRT(_1, EG(exception)); + if (zephir_instance_of_ev(_1, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { + zend_clear_exception(TSRMLS_C); + RETURN_MM_STRING("error", 1); + } } RETURN_MM_BOOL(0); @@ -168,17 +170,19 @@ PHP_METHOD(Test_TryTest, testTry4) { try_end_1: - ZEPHIR_INIT_NVAR(_1); - ZEPHIR_CPY_WRT(_1, EG(exception)); - if (zephir_instance_of_ev(_1, spl_ce_RuntimeException TSRMLS_CC)) { - zend_clear_exception(TSRMLS_C); - RETURN_MM_STRING("domain error", 1); - } - ZEPHIR_INIT_NVAR(_1); - ZEPHIR_CPY_WRT(_1, EG(exception)); - if (zephir_instance_of_ev(_1, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { - zend_clear_exception(TSRMLS_C); - RETURN_MM_STRING("error", 1); + if (EG(exception)) { + ZEPHIR_INIT_NVAR(_1); + ZEPHIR_CPY_WRT(_1, EG(exception)); + if (zephir_instance_of_ev(_1, spl_ce_RuntimeException TSRMLS_CC)) { + zend_clear_exception(TSRMLS_C); + RETURN_MM_STRING("domain error", 1); + } + ZEPHIR_INIT_NVAR(_1); + ZEPHIR_CPY_WRT(_1, EG(exception)); + if (zephir_instance_of_ev(_1, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { + zend_clear_exception(TSRMLS_C); + RETURN_MM_STRING("error", 1); + } } RETURN_MM_BOOL(0); @@ -225,15 +229,17 @@ PHP_METHOD(Test_TryTest, testTry5) { try_end_1: - ZEPHIR_INIT_NVAR(_1); - ZEPHIR_CPY_WRT(_1, EG(exception)); - if (zephir_instance_of_ev(_1, spl_ce_RuntimeException TSRMLS_CC)) { - zend_clear_exception(TSRMLS_C); - RETURN_MM_STRING("any error", 1); - } - if (zephir_instance_of_ev(_1, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { - zend_clear_exception(TSRMLS_C); - RETURN_MM_STRING("any error", 1); + if (EG(exception)) { + ZEPHIR_INIT_NVAR(_1); + ZEPHIR_CPY_WRT(_1, EG(exception)); + if (zephir_instance_of_ev(_1, spl_ce_RuntimeException TSRMLS_CC)) { + zend_clear_exception(TSRMLS_C); + RETURN_MM_STRING("any error", 1); + } + if (zephir_instance_of_ev(_1, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { + zend_clear_exception(TSRMLS_C); + RETURN_MM_STRING("any error", 1); + } } RETURN_MM_BOOL(0); @@ -280,15 +286,17 @@ PHP_METHOD(Test_TryTest, testTry6) { try_end_1: - ZEPHIR_CPY_WRT(e, EG(exception)); - if (zephir_instance_of_ev(e, spl_ce_RuntimeException TSRMLS_CC)) { - zend_clear_exception(TSRMLS_C); - RETURN_MM_STRING("domain error", 1); - } - ZEPHIR_CPY_WRT(e, EG(exception)); - if (zephir_instance_of_ev(e, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { - zend_clear_exception(TSRMLS_C); - RETURN_MM_STRING("error", 1); + if (EG(exception)) { + ZEPHIR_CPY_WRT(e, EG(exception)); + if (zephir_instance_of_ev(e, spl_ce_RuntimeException TSRMLS_CC)) { + zend_clear_exception(TSRMLS_C); + RETURN_MM_STRING("domain error", 1); + } + ZEPHIR_CPY_WRT(e, EG(exception)); + if (zephir_instance_of_ev(e, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { + zend_clear_exception(TSRMLS_C); + RETURN_MM_STRING("error", 1); + } } RETURN_MM_BOOL(0); @@ -335,14 +343,16 @@ PHP_METHOD(Test_TryTest, testTry7) { try_end_1: - ZEPHIR_CPY_WRT(e, EG(exception)); - if (zephir_instance_of_ev(e, spl_ce_RuntimeException TSRMLS_CC)) { - zend_clear_exception(TSRMLS_C); - RETURN_MM_STRING("any error", 1); - } - if (zephir_instance_of_ev(e, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { - zend_clear_exception(TSRMLS_C); - RETURN_MM_STRING("any error", 1); + if (EG(exception)) { + ZEPHIR_CPY_WRT(e, EG(exception)); + if (zephir_instance_of_ev(e, spl_ce_RuntimeException TSRMLS_CC)) { + zend_clear_exception(TSRMLS_C); + RETURN_MM_STRING("any error", 1); + } + if (zephir_instance_of_ev(e, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { + zend_clear_exception(TSRMLS_C); + RETURN_MM_STRING("any error", 1); + } } } @@ -394,7 +404,6 @@ PHP_METHOD(Test_TryTest, someMethod2) { PHP_METHOD(Test_TryTest, testTry9) { - zephir_nts_static zephir_fcall_cache_entry *_0 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *e = NULL; @@ -403,16 +412,18 @@ PHP_METHOD(Test_TryTest, testTry9) { /* try_start_1: */ - ZEPHIR_CALL_METHOD(NULL, this_ptr, "somemethod1", &_0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "somemethod1", NULL); zephir_check_call_status_or_jump(try_end_1); RETURN_MM_STRING("not catched", 1); try_end_1: - ZEPHIR_CPY_WRT(e, EG(exception)); - if (zephir_instance_of_ev(e, spl_ce_RuntimeException TSRMLS_CC)) { - zend_clear_exception(TSRMLS_C); - RETURN_MM_STRING("domain error", 1); + if (EG(exception)) { + ZEPHIR_CPY_WRT(e, EG(exception)); + if (zephir_instance_of_ev(e, spl_ce_RuntimeException TSRMLS_CC)) { + zend_clear_exception(TSRMLS_C); + RETURN_MM_STRING("domain error", 1); + } } RETURN_MM_BOOL(0); @@ -420,7 +431,6 @@ PHP_METHOD(Test_TryTest, testTry9) { PHP_METHOD(Test_TryTest, testTry10) { - zephir_nts_static zephir_fcall_cache_entry *_0 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *e = NULL; @@ -429,16 +439,18 @@ PHP_METHOD(Test_TryTest, testTry10) { /* try_start_1: */ - ZEPHIR_CALL_METHOD(NULL, this_ptr, "somemethod2", &_0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "somemethod2", NULL); zephir_check_call_status_or_jump(try_end_1); RETURN_MM_STRING("not catched", 1); try_end_1: - ZEPHIR_CPY_WRT(e, EG(exception)); - if (zephir_instance_of_ev(e, spl_ce_RuntimeException TSRMLS_CC)) { - zend_clear_exception(TSRMLS_C); - RETURN_MM_STRING("domain error", 1); + if (EG(exception)) { + ZEPHIR_CPY_WRT(e, EG(exception)); + if (zephir_instance_of_ev(e, spl_ce_RuntimeException TSRMLS_CC)) { + zend_clear_exception(TSRMLS_C); + RETURN_MM_STRING("domain error", 1); + } } RETURN_MM_BOOL(0); diff --git a/test/oo/DeprecatedMethods.zep b/test/oo/DeprecatedMethods.zep new file mode 100644 index 0000000000..42c516217a --- /dev/null +++ b/test/oo/DeprecatedMethods.zep @@ -0,0 +1,19 @@ +namespace Test\Oo; + +class DeprecatedMethods +{ + public deprecated function deprecatedMethod() + { + return true; + } + + public function normalMethod() + { + return this->privateDepricatedMethod(); + } + + private deprecated function privateDepricatedMethod() + { + return true; + } +} diff --git a/unit-tests/Extension/Oo/DeprecatedMethodsTest.php b/unit-tests/Extension/Oo/DeprecatedMethodsTest.php new file mode 100644 index 0000000000..edfaaefd58 --- /dev/null +++ b/unit-tests/Extension/Oo/DeprecatedMethodsTest.php @@ -0,0 +1,43 @@ +deprecatedMethod(); + } + + /** + * @expectedException \PHPUnit_Framework_Error_Deprecated + */ + public function testPrivateMethodThrowsDeprecatedWarning() + { + $test = new DeprecatedMethods; + $test->normalMethod(); + } +}