AllowedValuesConstraintValidator::validate
is more complex than it needs to be. Attached patch refactors this method to improve clarity and maintainability.
The following things have been changed:
- extract some logic into a new private method to reduce n-path complexity.
- call parent::validate if a value is set instead of returning prematurely if no value is set.