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

#23 Add support for using a behavior with protected or private methods #24

Merged
merged 2 commits into from
Oct 8, 2015

Conversation

jonyo
Copy link
Contributor

@jonyo jonyo commented Oct 8, 2015

See #23

$strategy = function() use ($strategy) {
return $strategy;
};
if (is_array($strategy) && count($strategy) === 2 && is_object($strategy[0]) && is_string($strategy[1])) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonyo This is a little subjective, I could be passing and event object and something else. Also it doesn't support static calls, so why don't simply use is_callable()? See http://viper-7.com/ZlreM2

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonyo Ok, talking with @young-steveo we saw that is_callable is not applicable for this since doesn't check the protected/private, but the method_exists does. So this is probably the best option for this case.

@jonyo jonyo force-pushed the allow-protected-method-behaviors branch from c4bc4aa to 95d3e83 Compare October 8, 2015 18:51
@jonyo
Copy link
Contributor Author

jonyo commented Oct 8, 2015

@jrbasso Good point, changes in.

young-steveo added a commit that referenced this pull request Oct 8, 2015
#23 Add support for using a behavior with protected or private methods
@young-steveo young-steveo merged commit a86cab1 into master Oct 8, 2015
@young-steveo young-steveo deleted the allow-protected-method-behaviors branch October 8, 2015 19:28
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

Successfully merging this pull request may close these issues.

3 participants