Skip to content
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

Intercept methods in traits #36

Closed
lisachenko opened this issue Jan 25, 2013 · 0 comments
Closed

Intercept methods in traits #36

lisachenko opened this issue Jan 25, 2013 · 0 comments
Labels
Milestone

Comments

@lisachenko
Copy link
Member

Traits are a mechanism for code reuse in single inheritance languages such as PHP. A Trait is intended to reduce some limitations of single inheritance by enabling a developer to reuse sets of methods freely in several independent classes living in different class hierarchies

New code can contain traits, so library should be able to intercept methods in traits. This can be done by generating proxy trait for original trait and renaming proxy trait to the original trait name to intercept methods.

This is an unique feature and probably an unique pattern of design that allows to create proxy even for trait! 🤘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant