Reflection
#402
Replies: 2 comments 19 replies
-
Hello, Have you looked into https://github.com/Roave/BetterReflection ? I think it solves most of the issues you mentioned. |
Beta Was this translation helpful? Give feedback.
1 reply
-
I like the idea of having a reflection API in PSL, that is better typed, it seems all good in theory, but implementing something that would be truly type safe is not really possible ( or at least not easy ). I'll be open to suggestions of how such an API would look like, then we can discuss it further. |
Beta Was this translation helpful? Give feedback.
18 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Lately I'm working on a mapping library and I would like to add annotation support.
I used PHP Native Reflection, but it is very inconsistent.
Many functions return
false
instead ofnull
, there is no way to get annotation directly, fetching types from properties, parameters and return is confusing...I saw that some libraries (PHPStan, for example) use their own Reflection implementation, so my question is: why there is not a dedicated library?
I'm not sure the scope of PSL project is to include reflection, but I think a standalone standardized tool would be very usefull.
What is your opinion?
Beta Was this translation helpful? Give feedback.
All reactions