symfony/symfony — pull request #6027 by nomack84 (2012-11-16 13:01:06+00:00)
Title: [OptionsResolver] Add the ability to set up mutually exclusive options.

Bug fix: NO
Feature addition: YES
Backwards compatibility break: NO
Symfony2 tests pass: YES
Usefull for the following ticket: #5827
License of the code: MIT

There are times where you want to define options which cannot coexist between them because any of them invalidated the others. This commit solve that issue by setting a list of options which cannot be defined at the same time.

#5827 propose to use a couple of options in the Form component (before/after). Both of this options cannot be used together, because they invalidated each other, so, they are mutually exclusive.

Usage is quite simple:
```php
$resolver->setMutuallyExclusive(array('before', 'after'));
```