Skip to content

ext/reflection: improve error messages#22813

Open
DanielEScherzer wants to merge 4 commits into
php:masterfrom
DanielEScherzer:reflection-cleanup-202607-errors
Open

ext/reflection: improve error messages#22813
DanielEScherzer wants to merge 4 commits into
php:masterfrom
DanielEScherzer:reflection-cleanup-202607-errors

Conversation

@DanielEScherzer

Copy link
Copy Markdown
Member

No description provided.

Add tests for the four error cases in
`reflection_property_check_lazy_compatible()`, as triggered by both
`ReflectionProperty::setRawValueWithoutLazyInitialization()` and
`ReflectionProperty::skipLazyInitialization()`. While some of these errors are
covered by existing tests, having all of the errors in one place will make it
easier to see the changes when the error messages are improved.
Improve error messages from `reflection_property_check_lazy_compatible()`, as
triggered by both `ReflectionProperty::setRawValueWithoutLazyInitialization()`
and `ReflectionProperty::skipLazyInitialization()`. Say "cannot" instead of
"can not", and include parentheses after the method name.
…error

Align with other Reflection exceptions for missing class properties (and
methods, constants, etc.) by changing the message to
"Property %s::$%s does not exist".
Comment thread ext/reflection/php_reflection.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants