@param Constraint[] $constraintList

@return TypeDoc
976582
public function guess(array $constraintList) : TypeDoc
    {
        return $this->getDocFromTypeConstraintOrPayloadDocIfExist($constraintList)
            ?? $this->typeGuesser->guessTypeFromConstraintList($constraintList)
            ?? new TypeDoc()
        ;
    }
352149
protected function constraint($class, array $columns)
    {
        $constraint = new $class($this->getBuilder(), $columns);

        $this->queue($constraint);

        return $constraint;
    }
32824
private function createMessage(ConstraintViolationListInterface $list, $line)
    {
        $messages = [];
        foreach ($list as $violation) {
            $messages[] = $violation->getMessage();
        }

        return sprintf('Line %d: %s', $line, implode(', ', $messages));
    }
79959
public function validate($value, Constraint $constraint)
    {
        /**@var $constraint CodeUnit */
        if (!in_array($value, $this->codes)) {
            $this->context->buildViolation($constraint->message)
                ->setParameter('{{ value }}', $value)
                ->addViolation();
        }
    }
437189
public function normalizeConstraints($constraint_class = NULL) {
    if ($constraint_class == NULL) {
      $classes = array_keys($this->constraints);
    } else {
      if (isset($this->constraints[$constraint_class])) {
        $classes = array($constraint_class);
      } else {
        return array();
      }
    }

    $new_constraints = array();

    foreach ($classes as $class) {
      switch ($class) {
        case 'Roomify\Bat\Constraint\MinMaxDaysConstraint':
          $new_constraints[$class] = $this->normalizeMinMaxDaysConstraints();
          break;

        case 'Roomify\Bat\Constraint\CheckInDayConstraint':
          $new_constraints[$class] = $this->normalizeCheckInDayConstraints();
          break;

        default:
          if (isset($this->constraints[$class])) {
            $new_constraints[$class] = $this->constraints[$class];
          }
      }
    }

    if ($constraint_class == NULL) {
      return $new_constraints;
    } else {
      return $new_constraints[$constraint_class];
    }
  }
278526
public void addConstraint( final FieldConstraint constraint ) {
        if ( this.constraints == null ) {
            this.constraints = new FieldConstraint[ 1 ];
            this.constraints[ 0 ] = constraint;
        } else {
            final FieldConstraint[] newList = new FieldConstraint[ this.constraints.length + 1 ];
            for ( int i = 0; i < this.constraints.length; i++ ) {
                newList[ i ] = this.constraints[ i ];
            }
            newList[ this.constraints.length ] = constraint;
            this.constraints = newList;
        }
    }
1018748
public static function create(ConstraintViolationListInterface $violationList, $code = 0, \Exception $prev = null)
    {
        $violationMessages = [];

        /** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */
        foreach ($violationList as $violation) {
            $violationMessages[] = sprintf(
                '[%s]: %s;',
                $violation->getPropertyPath(),
                $violation->getMessage()
            );
        }

        $message = 'Not valid. ' . implode(' ', $violationMessages);

        return new static($violationList, $message, $code, $prev);
    }
1363580
public function resolve(Constraint $constraint, FormInterface $form, RuleCollection $collection)
    {
        $constraintClass = get_class($constraint);

        /** @var \Symfony\Component\Validator\Constraints\AbstractComparison $constraint */
        if ($constraintClass === GreaterThan::class) {
            $rule = new ConstraintRule(
                self::RULE_NAME,
                $constraint->value + 1, // TODO support floats
                new RuleMessage($constraint->message, array('{{ compared_value }}' => $constraint->value)),
                $constraint->groups
            );
        } elseif ($constraintClass === GreaterThanOrEqual::class) {
            $rule = new ConstraintRule(
                self::RULE_NAME,
                $constraint->value,
                new RuleMessage($constraint->message, array('{{ compared_value }}' => $constraint->value)),
                $constraint->groups
            );
        }
        /** @var Range $constraint */
        elseif ($constraintClass === Range::class && $constraint->min !== null) {
            $rule = new ConstraintRule(
                self::RULE_NAME,
                $constraint->min,
                new RuleMessage($constraint->minMessage, array('{{ limit }}' => $constraint->min)),
                $constraint->groups
            );
        } else {
            throw new LogicException();
        }

        $collection->set(
            self::RULE_NAME,
            $rule
        );
    }
131020
private function guessSimplePrimaryTypeFromConstraint(Constraint $constraint) : ?TypeDoc
    {
        if (null !== $this->getMatchingClassNameIn($constraint, self::STRING_CONSTRAINT_CLASS_LIST)) {
            return new StringDoc();
        } elseif (null !== $this->getMatchingClassNameIn($constraint, self::BOOLEAN_CONSTRAINT_CLASS_LIST)) {
            return new BooleanDoc();
        } elseif ($constraint instanceof Assert\Regex) {
            return new ScalarDoc();
        } elseif ($this->isArrayConstraint($constraint)) {
            return new ArrayDoc();
        }

        return null;
    }
1022925
public function validate($value, Constraint $constraint)
    {
        $object = $this->context->getObject();
        $name = null;
        if (is_object($object)) {
            if (method_exists($object, 'getConfig'))
                $name = $object->getConfig()->getName();
            if (! $name && method_exists($object, '__toString'))
                $name = $object->__toString();
            if (! $name && method_exists($object, 'getName'))
                $name = $object->getName();
            if (! $name)
                $name = get_class($object);
        } else
            $name = strval($object);
        $this->context->buildViolation($constraint->message)
            ->setParameter('%{name}', $name)
            ->addViolation();
    }
749764
OrderedHashSet getContainingConstraints(int colIndex) {

        OrderedHashSet set = new OrderedHashSet();

        for (int i = 0, size = constraintList.length; i < size; i++) {
            Constraint c = constraintList[i];

            if (c.hasColumnPlus(colIndex)) {
                set.add(c);
            }
        }

        return set;
    }
217458
public function createConstraint(Constraint $constraint, $table)
    {
        $this->_execSql($this->_platform->getCreateConstraintSQL($constraint, $table));
    }
1308223
protected function getFormattedErrors(ConstraintViolationListInterface $constraintViolations,
                                          callable $formatter = null)
    {
        $errors = [];

        if (is_null($formatter)) {
            $formatter = function(ConstraintViolationInterface $constraintViolation) {
                return new Entity\Error($constraintViolation->getPropertyPath(), $constraintViolation->getMessage());
            };
        }

        /** @var ConstraintViolationInterface $constraintViolation */
        foreach ($constraintViolations as $constraintViolation) {
            $errors[] = $formatter($constraintViolation);
        }

        return $errors;
    }
720682
private function filterConstraintsForSchema(array $constraints, stdClass $schema)
    {
        $filtered = [];

        foreach ($constraints as $constraint) {
            foreach ($constraint->keywords() as $keyword) {
                if (property_exists($schema, $keyword)) {
                    $filtered[] = $constraint;
                    break;
                }
            }
        }

        return $filtered;
    }
102242
protected function transformConstraintArray(array $constraints)
    {
        $self = $this;

        return array_map(
            function (ConstraintInterface $constraint) use ($self) {
                return $constraint->accept($self);
            },
            $constraints
        );
    }
1084864
protected function createIssue(ConstraintInterface $constraint)
    {
        list($value, $pointer) = $this->currentContext();

        return new Result\ValidationIssue(
            $constraint,
            $value,
            $pointer
        );
    }
340940
public function visitItemsConstraint(ArrayValue\ItemsConstraint $constraint)
    {
        $value = $this->currentValue();
        if (!$value instanceof Value\ArrayValue) {
            return $this->createResult();
        }

        $result = $this->createResult();
        $matchedIndices = array();

        // items
        foreach ($constraint->schemas() as $index => $schema) {
            if ($value->has($index)) {
                $matchedIndices[$index] = true;
                $result = $result->merge(
                    $this->validateArrayIndex($index, $schema)
                );
            } elseif (null !== $schema->defaultValue()) {
                $result = $result->merge(
                    $this->createResult(
                        array(),
                        array($this->createDefaultValueMatch($schema, $index))
                    )
                );
            }
        }

        // additional items
        foreach ($value->keys() as $index) {
            if (!array_key_exists($index, $matchedIndices)) {
                $result = $result->merge(
                    $this->validateArrayIndex(
                        $index,
                        $constraint->additionalSchema()
                    )
                );
            }
        }

        return $result;
    }