diff options
author | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-08-16 21:49:20 +0200 |
---|---|---|
committer | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-09-09 10:47:43 +0200 |
commit | 9975986b7ef849c3a8e73a48748befbfdc50e416 (patch) | |
tree | b287480ec6e0d4853fa4e1f53d3627836b74d695 /ext/reflection | |
parent | c5b42be40e98f1626e2404af069af16cb6510ef3 (diff) | |
download | php-git-9975986b7ef849c3a8e73a48748befbfdc50e416.tar.gz |
Improve error messages mentioning parameters instead of arguments
Closes GH-5999
Diffstat (limited to 'ext/reflection')
16 files changed, 33 insertions, 33 deletions
diff --git a/ext/reflection/tests/ReflectionClass_constructor_002.phpt b/ext/reflection/tests/ReflectionClass_constructor_002.phpt index 44ff37a962..7df620eaaa 100644 --- a/ext/reflection/tests/ReflectionClass_constructor_002.phpt +++ b/ext/reflection/tests/ReflectionClass_constructor_002.phpt @@ -46,10 +46,10 @@ try { ?> --EXPECT-- -ReflectionClass::__construct() expects exactly 1 parameter, 0 given +ReflectionClass::__construct() expects exactly 1 argument, 0 given Class "" does not exist Class "1" does not exist Class "1" does not exist ReflectionClass::__construct(): Argument #1 ($objectOrClass) must be of type object|string, array given -ReflectionClass::__construct() expects exactly 1 parameter, 2 given +ReflectionClass::__construct() expects exactly 1 argument, 2 given Class "X" does not exist diff --git a/ext/reflection/tests/ReflectionClass_getMethod_002.phpt b/ext/reflection/tests/ReflectionClass_getMethod_002.phpt index 99d5bb7e86..8271822884 100644 --- a/ext/reflection/tests/ReflectionClass_getMethod_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getMethod_002.phpt @@ -56,8 +56,8 @@ try { ?> --EXPECT-- Check invalid params: -ReflectionClass::getMethod() expects exactly 1 parameter, 0 given -ReflectionClass::getMethod() expects exactly 1 parameter, 2 given +ReflectionClass::getMethod() expects exactly 1 argument, 0 given +ReflectionClass::getMethod() expects exactly 1 argument, 2 given Method C::() does not exist Method C::1() does not exist Method C::1.5() does not exist diff --git a/ext/reflection/tests/ReflectionClass_getProperty_002.phpt b/ext/reflection/tests/ReflectionClass_getProperty_002.phpt index 606a124d5c..80ef77c8a3 100644 --- a/ext/reflection/tests/ReflectionClass_getProperty_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getProperty_002.phpt @@ -54,8 +54,8 @@ try { ?> --EXPECT-- Check invalid params: -ReflectionClass::getProperty() expects exactly 1 parameter, 0 given -ReflectionClass::getProperty() expects exactly 1 parameter, 2 given +ReflectionClass::getProperty() expects exactly 1 argument, 0 given +ReflectionClass::getProperty() expects exactly 1 argument, 2 given Property C::$ does not exist Property C::$1 does not exist Property C::$1.5 does not exist diff --git a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt index 3e21780231..4a5a5929d5 100644 --- a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt @@ -39,8 +39,8 @@ try { ?> --EXPECT-- -ReflectionClass::getStaticPropertyValue() expects at most 2 parameters, 3 given -ReflectionClass::getStaticPropertyValue() expects at least 1 parameter, 0 given +ReflectionClass::getStaticPropertyValue() expects at most 2 arguments, 3 given +ReflectionClass::getStaticPropertyValue() expects at least 1 argument, 0 given Property C::$ does not exist string(3) "def" ReflectionClass::getStaticPropertyValue(): Argument #1 ($name) must be of type string, array given diff --git a/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt b/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt index 0ea64ca278..5fb158cb8d 100644 --- a/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt +++ b/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt @@ -144,8 +144,8 @@ Does I2 implement I2? Test bad arguments: -ReflectionClass::implementsInterface() expects exactly 1 parameter, 0 given -ReflectionClass::implementsInterface() expects exactly 1 parameter, 2 given +ReflectionClass::implementsInterface() expects exactly 1 argument, 0 given +ReflectionClass::implementsInterface() expects exactly 1 argument, 2 given Interface "" does not exist Interface "ThisClassDoesNotExist" does not exist Interface "2" does not exist diff --git a/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt b/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt index d69c16d6ac..51fc52b8ee 100644 --- a/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt +++ b/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt @@ -37,8 +37,8 @@ try { ?> --EXPECT-- Test bad arguments: -ReflectionClass::isSubclassOf() expects exactly 1 parameter, 0 given -ReflectionClass::isSubclassOf() expects exactly 1 parameter, 2 given +ReflectionClass::isSubclassOf() expects exactly 1 argument, 0 given +ReflectionClass::isSubclassOf() expects exactly 1 argument, 2 given Class "" does not exist Class "ThisClassDoesNotExist" does not exist Class "2" does not exist diff --git a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt index b9bb76c786..7bd2b1eecd 100644 --- a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt +++ b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt @@ -44,9 +44,9 @@ try { ?> --EXPECT-- -ReflectionClass::setStaticPropertyValue() expects exactly 2 parameters, 3 given -ReflectionClass::setStaticPropertyValue() expects exactly 2 parameters, 0 given -ReflectionClass::setStaticPropertyValue() expects exactly 2 parameters, 1 given +ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 3 given +ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 0 given +ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 1 given Class C does not have a property named Class C does not have a property named 1.5 ReflectionClass::setStaticPropertyValue(): Argument #1 ($name) must be of type string, array given diff --git a/ext/reflection/tests/ReflectionExtension_constructor_error.phpt b/ext/reflection/tests/ReflectionExtension_constructor_error.phpt index ccf2414e43..f4241bcd92 100644 --- a/ext/reflection/tests/ReflectionExtension_constructor_error.phpt +++ b/ext/reflection/tests/ReflectionExtension_constructor_error.phpt @@ -25,7 +25,7 @@ try { ?> ---EXPECTF-- -Ok - ReflectionExtension::__construct() expects exactly %d parameter, %d given -Ok - ReflectionExtension::__construct() expects exactly %d parameter, %d given +--EXPECT-- +Ok - ReflectionExtension::__construct() expects exactly 1 argument, 0 given +Ok - ReflectionExtension::__construct() expects exactly 1 argument, 2 given Ok - ReflectionExtension::__construct(): Argument #1 ($name) must be of type string, array given diff --git a/ext/reflection/tests/ReflectionFunction_construct.001.phpt b/ext/reflection/tests/ReflectionFunction_construct.001.phpt index 307da25e54..f7020699d5 100644 --- a/ext/reflection/tests/ReflectionFunction_construct.001.phpt +++ b/ext/reflection/tests/ReflectionFunction_construct.001.phpt @@ -37,6 +37,6 @@ try { --EXPECT-- Ok - ReflectionFunction::__construct(): Argument #1 ($function) must be of type Closure|string, array given Function nonExistentFunction() does not exist -Ok - ReflectionFunction::__construct() expects exactly 1 parameter, 0 given -Ok - ReflectionFunction::__construct() expects exactly 1 parameter, 2 given +Ok - ReflectionFunction::__construct() expects exactly 1 argument, 0 given +Ok - ReflectionFunction::__construct() expects exactly 1 argument, 2 given Ok - ReflectionFunction::__construct(): Argument #1 ($function) must be of type Closure|string, array given diff --git a/ext/reflection/tests/ReflectionMethod_006.phpt b/ext/reflection/tests/ReflectionMethod_006.phpt index bb29b1cbed..e32c73b8be 100644 --- a/ext/reflection/tests/ReflectionMethod_006.phpt +++ b/ext/reflection/tests/ReflectionMethod_006.phpt @@ -19,5 +19,5 @@ try { ?> --EXPECT-- -Ok - ReflectionMethod::__construct() expects exactly 1 parameter, 0 given -Ok - ReflectionMethod::__construct() expects exactly 1 parameter, 3 given +Ok - ReflectionMethod::__construct() expects exactly 1 argument, 0 given +Ok - ReflectionMethod::__construct() expects exactly 1 argument, 3 given diff --git a/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt b/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt index 0b02fb651c..2a8b30bf03 100644 --- a/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt +++ b/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt @@ -52,10 +52,10 @@ try{ ?> --EXPECT-- Too few arguments: -Ok - ReflectionMethod::__construct() expects exactly 1 parameter, 0 given +Ok - ReflectionMethod::__construct() expects exactly 1 argument, 0 given Too many arguments: -Ok - ReflectionMethod::__construct() expects exactly 1 parameter, 3 given +Ok - ReflectionMethod::__construct() expects exactly 1 argument, 3 given Ok - Class "InvalidClassName" does not exist Ok - ReflectionMethod::__construct(): Argument #1 ($objectOrMethod) must be of type object|string, array given -Ok - ReflectionMethod::__construct() expects exactly 1 parameter, 2 given +Ok - ReflectionMethod::__construct() expects exactly 1 argument, 2 given diff --git a/ext/reflection/tests/ReflectionMethod_invoke_basic.phpt b/ext/reflection/tests/ReflectionMethod_invoke_basic.phpt index 73c04a687b..92bd054338 100644 --- a/ext/reflection/tests/ReflectionMethod_invoke_basic.phpt +++ b/ext/reflection/tests/ReflectionMethod_invoke_basic.phpt @@ -102,7 +102,7 @@ Called methodWithArgs(1, arg2) NULL Static method: -ReflectionMethod::invoke() expects at least 1 parameter, 0 given +ReflectionMethod::invoke() expects at least 1 argument, 0 given ReflectionMethod::invoke(): Argument #1 ($object) must be of type ?object, bool given Called staticMethod() Exception: Using $this when not in object context diff --git a/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt b/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt index 41042b7530..ceedc7d4f0 100644 --- a/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt +++ b/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt @@ -37,8 +37,8 @@ try { ?> --EXPECT-- Test bad arguments: -ReflectionClass::isSubclassOf() expects exactly 1 parameter, 0 given -ReflectionClass::isSubclassOf() expects exactly 1 parameter, 2 given +ReflectionClass::isSubclassOf() expects exactly 1 argument, 0 given +ReflectionClass::isSubclassOf() expects exactly 1 argument, 2 given Class "" does not exist Class "ThisClassDoesNotExist" does not exist Class "2" does not exist diff --git a/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt b/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt index 5fa249a9b5..917f079fd9 100644 --- a/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt +++ b/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt @@ -43,6 +43,6 @@ echo "Done.\n"; Class "A" does not exist Method C::b() does not exist Method C::b() does not exist -Ok - ReflectionParameter::__construct() expects exactly 2 parameters, 1 given +Ok - ReflectionParameter::__construct() expects exactly 2 arguments, 1 given Ok - ReflectionParameter::__construct(): Argument #1 ($function) must be either a string, an array(class, method) or a callable object, int given Done. diff --git a/ext/reflection/tests/ReflectionProperty_error.phpt b/ext/reflection/tests/ReflectionProperty_error.phpt index 052bfcb97c..bb53599ce6 100644 --- a/ext/reflection/tests/ReflectionProperty_error.phpt +++ b/ext/reflection/tests/ReflectionProperty_error.phpt @@ -26,6 +26,6 @@ try { ?> --EXPECT-- -Ok - ReflectionProperty::__construct() expects exactly 2 parameters, 0 given -Ok - ReflectionProperty::__construct() expects exactly 2 parameters, 1 given -Ok - ReflectionProperty::__construct() expects exactly 2 parameters, 3 given +Ok - ReflectionProperty::__construct() expects exactly 2 arguments, 0 given +Ok - ReflectionProperty::__construct() expects exactly 2 arguments, 1 given +Ok - ReflectionProperty::__construct() expects exactly 2 arguments, 3 given diff --git a/ext/reflection/tests/ReflectionProperty_getValue_error.phpt b/ext/reflection/tests/ReflectionProperty_getValue_error.phpt index 49b3c7bd9a..544c1d6b25 100644 --- a/ext/reflection/tests/ReflectionProperty_getValue_error.phpt +++ b/ext/reflection/tests/ReflectionProperty_getValue_error.phpt @@ -57,7 +57,7 @@ try { Instance without property: Static property / too many args: -ReflectionProperty::getValue() expects at most 1 parameter, 2 given +ReflectionProperty::getValue() expects at most 1 argument, 2 given Protected property: Cannot access non-public property TestClass::$prot |