-
Notifications
You must be signed in to change notification settings - Fork 129
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
Fix behaviour of ReflectionClass::export/ReflectionObject::export to match behaviour of core classes #397
Conversation
…match behaviour of core classes
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.
I'd rather adapt the behavior of the Roave\BetterReflection\Adapter\*::export()
symbols to what internal reflection does, and completely deprecate Roave\BetterReflection\*::export()
methods, which shouldn't be used in first place, in my opinion.
The idea of exporting reflection is not really core to the package, and I think this is a mistake that we initially did in designing the package overall by implementing Reflector
on Roave\BetterReflection\Reflection\*
.
@asgrim do you remember why we did that? And can we chop its head off, since we now have the entire Adapter
namespace?
ping @asgrim |
@Ocramius @theofidry indeed the With that said, this change looks good, but only if we can remove it from the main BR reflections and just do it in |
Gah, Better Reflection class implements |
I mean - we can implement the |
@asgrim what about introducing a BC Break where we move the |
@Ocramius actually yes that seems like a reasonable approach, it's a BC break regardless, so I'm +1 on that. I'll see if I can get to that at some point! |
Only took like 4 months - opened a new PR in #479 as I don't think I can push to this one. |
Roave\BetterReflection\Reflection\ReflectionClass::export
andRoave\BetterReflection\Reflection\ReflectionObject::export
would alwaysreturn
values. However,ReflectionClass::export
andReflectionObject::export
echo values to stdout by default,.This PR changes the default behaviour of the BetterReflection classes to match up with the core ones. Now the
return
functionality is hidden behind an explicitbool $return
argument.It also allows
ReflectionClass::export
to take an object instance, like its core equivalent.