Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291555

Simplify AllowedValuesConstraintValidator::validate

$
0
0

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:

  1. extract some logic into a new private method to reduce n-path complexity.
  2. call parent::validate if a value is set instead of returning prematurely if no value is set.

Viewing all articles
Browse latest Browse all 291555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>