Skip to content

ext/reflection: various cleanups and simplifications (3)#22795

Open
DanielEScherzer wants to merge 6 commits into
php:masterfrom
DanielEScherzer:reflection-cleanup-202607-r3
Open

ext/reflection: various cleanups and simplifications (3)#22795
DanielEScherzer wants to merge 6 commits into
php:masterfrom
DanielEScherzer:reflection-cleanup-202607-r3

Conversation

@DanielEScherzer

Copy link
Copy Markdown
Member

No description provided.

Use `uint32_t` for values that are really `uint32_t`, like constant module
numbers and the result from `zend_hash_num_elements()`. Use `uint32_t` for
counting up, when values should never be negative. Adjust format specifiers to
use `%u` rather than `%d` for the unsigned values.
Put the `*` next to the name, rather than the type
Avoid tabs or multiple spaces other than for indentation, remove a leading
newline from `ReflectionProperty::hasHook()`

@Girgias Girgias left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit regarding the printf style format strings, otherwise LGTM.

/* The information where a class is declared is only available for user classes */
if (ce->type == ZEND_USER_CLASS) {
smart_str_append_printf(str, "%s @@ %s %d-%d\n", indent, ZSTR_VAL(ce->info.user.filename),
smart_str_append_printf(str, "%s @@ %s %u-%u\n", indent, ZSTR_VAL(ce->info.user.filename),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's a uint32_t the specifier should be %" PRIu32 "

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