diff options
author | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-05-25 19:28:15 +0200 |
---|---|---|
committer | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-05-26 19:06:19 +0200 |
commit | fbe30592d6bec94463c68b27eabffca3a50c474e (patch) | |
tree | 5f7e2ca5bb754504eb0e4f7a49609088832172aa /ext/reflection | |
parent | 38c85efe83004d98b7cce89689b40de32f8b8add (diff) | |
download | php-git-fbe30592d6bec94463c68b27eabffca3a50c474e.tar.gz |
Improve type error messages when an object is given
From now on, we always display the given object's type instead of just reporting "object".
Additionally, make the format of return type errors match the format of argument errors.
Closes GH-5625
Diffstat (limited to 'ext/reflection')
-rw-r--r-- | ext/reflection/tests/ReflectionClass_getMethod_002.phpt | 2 | ||||
-rw-r--r-- | ext/reflection/tests/ReflectionClass_getProperty_002.phpt | 2 | ||||
-rw-r--r-- | ext/reflection/tests/ReflectionReference_errors.phpt | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/ext/reflection/tests/ReflectionClass_getMethod_002.phpt b/ext/reflection/tests/ReflectionClass_getMethod_002.phpt index e48d43587e..e5dce75367 100644 --- a/ext/reflection/tests/ReflectionClass_getMethod_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getMethod_002.phpt @@ -63,4 +63,4 @@ Method 1 does not exist Method 1.5 does not exist Method 1 does not exist ReflectionClass::getMethod(): Argument #1 ($name) must be of type string, array given -ReflectionClass::getMethod(): Argument #1 ($name) must be of type string, object given +ReflectionClass::getMethod(): Argument #1 ($name) must be of type string, C given diff --git a/ext/reflection/tests/ReflectionClass_getProperty_002.phpt b/ext/reflection/tests/ReflectionClass_getProperty_002.phpt index 86060c8acf..61d29b89d7 100644 --- a/ext/reflection/tests/ReflectionClass_getProperty_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getProperty_002.phpt @@ -61,4 +61,4 @@ Property 1 does not exist Property 1.5 does not exist Property 1 does not exist ReflectionClass::getProperty(): Argument #1 ($name) must be of type string, array given -ReflectionClass::getProperty(): Argument #1 ($name) must be of type string, object given +ReflectionClass::getProperty(): Argument #1 ($name) must be of type string, C given diff --git a/ext/reflection/tests/ReflectionReference_errors.phpt b/ext/reflection/tests/ReflectionReference_errors.phpt index 88244b7940..0d1d63eb28 100644 --- a/ext/reflection/tests/ReflectionReference_errors.phpt +++ b/ext/reflection/tests/ReflectionReference_errors.phpt @@ -41,7 +41,7 @@ var_dump(unserialize('O:19:"ReflectionReference":0:{}')); ?> --EXPECTF-- Call to private ReflectionReference::__construct() from invalid context -ReflectionReference::fromArrayElement(): Argument #1 ($array) must be of type array, object given +ReflectionReference::fromArrayElement(): Argument #1 ($array) must be of type array, stdClass given ReflectionReference::fromArrayElement(): Argument #2 ($key) must be of type string|int, float given Array key not found Serialization of 'ReflectionReference' is not allowed |