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

Extend ConfigurationGenerator to also deal with protected methods. #10

Closed
shochdoerfer opened this issue Nov 29, 2015 · 1 comment
Closed
Milestone

Comments

@shochdoerfer
Copy link
Member

Extend ConfigurationGenerator to also deal with protected methods. Protected methods could be used as "internal" dependencies which cannot retrieved externally by calling the get() method on the BeanFactory but can be used as dependencies for other instances. For example I do not want to expose my database connection object to the public but use it as an internal dependency.

Currently is this already possible but all annotations get ignored as no wrapper methods get generated in the proxy class.

@shochdoerfer
Copy link
Member Author

@skoop: Here are some more insights for you to get started easily ;)

Have a look at the \bitExpert\Disco\Proxy\Configuration\ConfigurationGenerator class. We grab the public methods like this:

$methods = $originalClass->getMethods(ReflectionMethod::IS_PUBLIC);

Either do the call a second time to grab the procteced methods or maybe the parameter is a bit field. Not sure. Also not sure if it is necessary to extend the BeanMethod::generateMethod method because protected methods should also be marked as protected in the generated proxy class. It "should" work out-of-the-box I assume, but I might be wrong ;)

skoop added a commit to Ingewikkeld/disco that referenced this issue Dec 6, 2015
skoop added a commit to Ingewikkeld/disco that referenced this issue Dec 6, 2015
shochdoerfer added a commit that referenced this issue Dec 6, 2015
#10: Not just fetch public methods but also fetch protected methods
@shochdoerfer shochdoerfer added this to the 0.2.0 milestone Dec 6, 2015
shochdoerfer added a commit to shochdoerfer/disco that referenced this issue May 26, 2016
shochdoerfer added a commit that referenced this issue May 26, 2016
Fixes #10. has() will no longer return true for protected methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant