-
-
Notifications
You must be signed in to change notification settings - Fork 587
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Multiple exclusion strategy #44
Conversation
I've just two remarks:
|
Ah, and one more, please add a unit test instead of the functional tests. This is far easier here. |
{ | ||
if (is_string($strategy)) { | ||
unset($this->chain[$strategy]); | ||
} elseif (false !== ($index = array_search($strategy, $this->chain, true))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of using array_search, you could simply check if $this->chain[get_class($strategy)] === $strategy
, as you are using the class name as key currently
About the name, Disjunct is probably too academic. At least I couldn't immediately grasp it. What about "Multiple"? |
@Narretz the issue is that there is 2 ways to implement the composed strategy: |
*/ | ||
class ChainExclusionStrategy implements ExclusionStrategyInterface | ||
{ | ||
private $chain = array(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@schmittjoh should this use an array or do you prefer using a PhpCollection\SequenceInterface
?
Maybe we can borrow a term from Security component here. What about "MultipleAffirmative"? Other than that, Disjunct is fine, if the docs make it clear what it means. |
ChainExclusionStrategy, as first implemented by @adrienbrault in schmittjoh/JMSSerializerBundle#140 and recently brought up again in #39. Strategy must be set explicitly, otherwise the behavior stays the same as currently.