function ConstraintManager::processDefinition

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Validation/ConstraintManager.php \Drupal\Core\Validation\ConstraintManager::processDefinition()
  2. 10 core/lib/Drupal/Core/Validation/ConstraintManager.php \Drupal\Core\Validation\ConstraintManager::processDefinition()
  3. 11.x core/lib/Drupal/Core/Validation/ConstraintManager.php \Drupal\Core\Validation\ConstraintManager::processDefinition()

Overrides DefaultPluginManager::processDefinition

File

core/lib/Drupal/Core/Validation/ConstraintManager.php, line 113

Class

ConstraintManager
Constraint plugin manager.

Namespace

Drupal\Core\Validation

Code

public function processDefinition(&$definition, $plugin_id) {
    // Make sure 'type' is set and either an array or FALSE.
    if ($definition['type'] !== FALSE && !is_array($definition['type'])) {
        $definition['type'] = [
            $definition['type'],
        ];
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.