Replies: 1 comment 1 reply
-
Good remark. This package just mimics Laravel's |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The current mechanism overrides the parent's macros when using the same name. Check this test for example:
The first assertion will fail. That's actually a side-effect of a bigger issue - all of the class descendants will share the same macros object instead of having their own object and just inherit from the parent when needed (like pure OOP).
I'm not sure how we can solve this. The only way that came to my mind is to change the macros object structure a little bit, maybe something like this:
And then when calling the macro, maybe use ReflectionClass::getParentClass() recursively, but it feels kinda complicated. WDYT?
Beta Was this translation helpful? Give feedback.
All reactions