-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Bugfix 80097: Have ReflectionAttribute implement Reflector, __toString #6117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@beberlei this looks like an easy win, can you move this forward please ? (nobody complained, ship it, imo) |
I think I complained at the time, but I changed my mind and this looks fine :) |
I think it would be good to include arguments. Maybe you can use the format_default_value logic to print a compact representation?
I think that would make sense, yes.
Don't think that's a concern, because attribute uses (which is what ReflectionAttribute is about) aren't distinct symbols. This is also kind of covered by the previous point. |
@beberlei, this looks like it's waiting on some feedback from you before I can merge it in. |
Ah will check in the next days |
I'd like this to get merged to have |
be19048
to
3d9c603
Compare
Argument #1 [ b = 1234 ] | ||
} | ||
} | ||
Attribute [ Baz ] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks okay, but I wonder if it would make sense to print it as
Attribute [ Baz('foo', 1234) ]
or even
#[Baz('foo', 1234)]
instead?
Maybe this doesn't compose well when included in other reflection output though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the idea was that this gets its own _attribute_string
at some point and nests into the existing reflection structures that look this way.
Co-authored-by: Nikita Popov <[email protected]>
Thank you! |
https://bugs.php.net/bug.php?id=80097
Questions:
php -r*
?