You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR #1234 made Adapter reflection incompatible with the native PHP reflection. The native reflection returns false in has* methods if it's asked about nonexistent elements, and throws ReflectionException in get* methods: https://3v4l.org/YebV9
But the assert($name !== ''); calls are unforgiving even for has* methods. The current situation isn't great, because these methods have string in parameter types but reject '' at runtime. So currently these problems cannot be detected and avoided with static analysis.
I'd prefer if the Adapter namespace matched the behaviour of native reflection:
For has* methods, instead of the assert, do this:
if ($s === '') {
returnfalse;
}
For get* methods, throw ReflectionException for empty strings.
Thank you.
The text was updated successfully, but these errors were encountered:
This PR #1234 made Adapter reflection incompatible with the native PHP reflection. The native reflection returns
false
inhas*
methods if it's asked about nonexistent elements, and throws ReflectionException inget*
methods: https://3v4l.org/YebV9But the
assert($name !== '');
calls are unforgiving even forhas*
methods. The current situation isn't great, because these methods havestring
in parameter types but reject''
at runtime. So currently these problems cannot be detected and avoided with static analysis.I'd prefer if the Adapter namespace matched the behaviour of native reflection:
For
has*
methods, instead of the assert, do this:For
get*
methods, throw ReflectionException for empty strings.Thank you.
The text was updated successfully, but these errors were encountered: