@param ArrayValue\ItemsConstraint $constraint

@return ArrayValue\ItemsConstraint
516165
public function visitItemsConstraint(ArrayValue\ItemsConstraint $constraint)
    {
        return new ArrayValue\ItemsConstraint(
            $this->transformConstraintArray($constraint->schemas()),
            $constraint->additionalSchema()->accept($this)
        );
    }
713137
public function addPropertyConstraints($property, array $constraints)
    {
        foreach ($constraints as $constraint) {
            $this->addPropertyConstraint($property, $constraint);
        }

        return $this;
    }
1170560
protected function useConstraint(
        array $groups,
        Constraint\ConstraintInterface $constraint
    ) {
        return count(array_intersect($constraint->getGroups(), $groups)) > 0;
    }
621080
public function visitOneOfConstraint(Generic\OneOfConstraint $constraint)
    {
        return new Generic\OneOfConstraint(
            $this->transformConstraintArray($constraint->schemas())
        );
    }
275789
public function visitMaximumDateTimeConstraint(DateTimeValue\MaximumDateTimeConstraint $constraint)
    {
        return sprintf(
            'The date-time value must not be after %s.',
            var_export($constraint->maximum()->format('c'), true)
        );
    }
24894
public function visitPropertiesConstraint(ObjectValue\PropertiesConstraint $constraint)
    {
        return new ObjectValue\PropertiesConstraint(
            $this->transformConstraintArray($constraint->schemas()),
            $this->transformConstraintArray($constraint->patternSchemas()),
            $constraint->additionalSchema()->accept($this)
        );
    }
665386
protected function guessTypeFromConstraint(Constraint $constraint) : ?TypeDoc
    {
        if (null !== ($type = $this->guessPrimaryTypeFromConstraint($constraint))) {
            return $type;
        }

        // If primary type is still not defined
        $constraintClass = get_class($constraint);
        if (Assert\Count::class == $constraintClass) {
            return new CollectionDoc();
        }

        return null;
    }
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;
    }
958237
public function validate($basket, Constraint $constraint)
    {
        foreach ($basket->getBasketElements() as $pos => $basketElement) {
            // create a new ErrorElement object
            $errorElement = new ErrorElement(
                $basket,
                $this->constraintValidatorFactory,
                $this->context,
                $this->context->getGroup()
            );

            $errorElement->with('basketElements['.$pos.']');

            // validate the basket element through the related service provider
            $this->productPool
                ->getProvider($basketElement->getProductCode())
                ->validateFormBasketElement($errorElement, $basketElement, $basket);
        }

        if (\count($this->context->getViolations()) > 0) {
            $this->context->addViolationAt('basketElements', $constraint->message);
        }
    }
574919
public function visitUniqueItemsConstraint(ArrayValue\UniqueItemsConstraint $constraint)
    {
        $value = $this->currentValue();
        if (
            !$value instanceof Value\ArrayValue ||
            !$constraint->value() ||
            $this->comparator->equals(
                $value->value(),
                $this->unique($value->value())
            )
        ) {
            return $this->createResult();
        }

        return $this->createSingleIssueResult($constraint);
    }
162104
protected function validateDelimiter(Constraint $constraint)
    {
        if (strlen($constraint->delimiter) > 2) {
            throw new ConstraintDefinitionException(sprintf('"%s" is not a valid delimiter', $constraint->delimiter));
        }
    }
792804
private function isRequired(Constraint $constraint): bool
    {
        foreach (self::REQUIRED_CONSTRAINTS as $requiredConstraint) {
            if ($constraint instanceof $requiredConstraint) {
                return true;
            }
        }

        return false;
    }
1066284
public static function normalize(Constraint $constraint)
    {
        return [
            'name'      => $constraint->getName(),
            'options'   => array_map(
                function (ConstraintOption $option) {
                    return [
                        'name'  => $option->getName(),
                        'value' => $option->getValue(),
                    ];
                },
                $constraint->getOptions()
            ),
        ];
    }
410580
public function validate($value, Constraint $constraint)
    {
        /** @var \Symfony\Component\Form\Form $root */
        $root = $this->context->getRoot();

        /** @var \Generated\Shared\Transfer\QuoteTransfer $data */
        $data = $root->getData();

        $validationMessages = $this->manageMandate($data, $constraint);

        if (count($validationMessages) === 0) {
            return;
        }

        foreach ($validationMessages as $validationMessage) {
            $this->context->buildViolation($validationMessage)
                ->addViolation();
        }
    }
637065
public function addConstraint(Constraint $constraint) : void
    {
        $constraint->setValidator($this);
        array_push($this->constraints, $constraint);
    }
1085637
protected function _getUniqueConstraint(Constraint\Unique $constraint)
    {
        $this->_afterCreate[] = sprintf(
            'CREATE UNIQUE INDEX %s ON %s(%s)',
            $constraint->getName(),
            $this->_sql->getTable(),
            $constraint->getColumn()
        );
        return null;
    }
1345269
public function visitNotConstraint(Generic\NotConstraint $constraint)
    {
        return new Generic\NotConstraint($constraint->schema()->accept($this));
    }