/**
  * Load and populate constraints with values, and add them to the Config
  *
  * @param Config $config
  *
  * @param array $formData
  */
 private function _addConstraints(Config $config, array $formData)
 {
     if (empty($formData['constraints'])) {
         return;
     }
     $constraintData = $formData['constraints'];
     if (!is_array($constraintData)) {
         $type = gettype($constraintData) === 'object' ? get_class($constraintData) : gettype($constraintData);
         throw new \LogicException('Constraint form data must be an array, ' . $type . ' given');
     }
     foreach ($constraintData as $name => $value) {
         if (null === $value) {
             continue;
         }
         $constraint = clone $this->_constraints->get($name);
         $constraint->setValue($value);
         $config->addConstraint($constraint);
     }
 }