Bugfix 80097: Have ReflectionAttribute implement Reflector, __toString#6117
Bugfix 80097: Have ReflectionAttribute implement Reflector, __toString#6117beberlei wants to merge 2 commits intophp:masterfrom
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.
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.
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*?