-
Notifications
You must be signed in to change notification settings - Fork 71
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
RFC: Lazy instantiation and unification of reflection classes in MethodMetadata and PropertyMetadata #77
Comments
That could be an interesting thing to do. Are you using |
For now, I'm more interested in Perhaps I could even omit creating the |
if is a performance improvement, I would say yes. I have removed reflection from the other metadata type for exactly the same reason.
If is backward compatible, yes. |
Ok, I will provide a pull request within the next days. One question: My proposal comprises two parts: Peformance improvement of
Consistent behavior:
Are both parts desired? I'm only interested in the performance improvement. But I can provide the consistent behavior as well. |
|
Sorry, I've forgotten to comment on that issue. The pull request handles the performance improvement ensuring backward-compatibility, but does not re-introduce the reflection property to |
closed via #78 |
As far as I see it, there is an inconsistency in
MethodMetadata
andPropertyMetadata
:MethodMetadata::__construct()
(and::unserialize()
) instantiate aReflectionMethod
. Additionally the class offeres aninvoke()
methodPropertyMetadata
does not have such behavior and does not create a reflection class.I see two problems:
Proposal
I assume, it would have been best not to provide the
$reflection
property inMethodMetadata
at all. But you can't remove it for now as that would be a BC break. Therefore I propose:ReflectionMethod
only if needed and save it internally for later reuse.MethodMetadata->reflection
private and provide a__get()
that handles this case.PropertyMetadata
.Questions
The text was updated successfully, but these errors were encountered: