@param DateTimeValue\MaximumDateTimeConstraint $constraint

@return Result\ValidationResult
198206
public function visitMaximumDateTimeConstraint(DateTimeValue\MaximumDateTimeConstraint $constraint)
    {
        $value = $this->currentValue();
        if (
            !$value instanceof Value\DateTimeValue ||
            $value->value() <= $constraint->maximum()
        ) {
            return $this->createResult();
        }

        return $this->createSingleIssueResult($constraint);
    }
313718
public function validate($password, Constraint $constraint)
    {
        if (null === $password || '' === $password) {
            $this->context->addViolation($constraint->message);

            return;
        }

        $user = $this->tokenStorage->getToken()->getUser()->getAPIUser();

        if (!$user instanceof User) {
            throw new ConstraintDefinitionException('The User object must implement the UserReference interface.');
        }

        try {
            $this->userService->loadUserByCredentials($user->login, $password);
        } catch (NotFoundException | InvalidArgumentException $e) {
            $this->context->buildViolation($constraint->message)->addViolation();
        }
    }
640932
public function visitMinimumConstraint(NumberValue\MinimumConstraint $constraint)
    {
        $value = $this->currentValue();
        if (
            !$value instanceof Value\NumberValueInterface ||
            $value->value() >= $constraint->minimum()
        ) {
            return $this->createResult();
        }

        return $this->createSingleIssueResult($constraint);
    }
1034884
public function visitEmailFormatConstraint(StringValue\EmailFormatConstraint $constraint)
    {
        if (!$this->formatValidationEnabled()) {
            return $this->createResult();
        }

        $value = $this->currentValue();
        if (
            !$value instanceof Value\StringValue ||
            $this->emailValidator()->isValid($value->value())
        ) {
            return $this->createResult();
        }

        return $this->createSingleIssueResult($constraint);
    }
516165
public function visitItemsConstraint(ArrayValue\ItemsConstraint $constraint)
    {
        return new ArrayValue\ItemsConstraint(
            $this->transformConstraintArray($constraint->schemas()),
            $constraint->additionalSchema()->accept($this)
        );
    }
1303735
public function validate($value, Constraint $constraint)
    {
        $result = $this->repository->hasOtherNodeWithSameParentAndOrder(
            $value->getParentId(),
            $value->getOrder(),
            $value->getNodeId(),
            $value->getSiteId()
        );

        if (true === $result) {
            $this->context->buildViolation($constraint->message)->addViolation();
        }
    }
510340
public function validate($entity, Constraint $constraint)
    {
        if (!$entity instanceof ClientDetailsInterface) {
            throw new \InvalidArgumentException('Expected instance of ClientDetailsInterface');
        }
        
        $result = $entity->isPasswordConfirmed();
        
        if (true === $result) {
            return;
        }
        
        if ($this->context instanceof ExecutionContextInterface) {
            $this->context
                ->buildViolation($constraint->message)
                ->atPath('hashedPassword')
                ->addViolation();
            
            $this->context
                ->buildViolation($constraint->message)
                ->atPath('passwordConfirm')
                ->addViolation();
        }
    }
1173011
public function validate($value, Constraint $constraint)
    {
        /** @var SetType $constraint */
        if (!$constraint->class) {
            throw new ConstraintDefinitionException('Target is not specified');
        }

        /** @var string $class class name of inheriting \Okapon\DoctrineSetTypeBundle\DBAL\Types\AbstractSetType */
        $class = $constraint->class;
        if (!class_exists($class)) {
            throw new TargetClassNotExistException('Target class not exist.');
        }

        $constraint->choices = $class::getValues();
        $constraint->multiple =true;

        parent::validate($value, $constraint);
    }
1146590
public function validate($propertyValue, Constraint $constraint)
    {
        // Implement your validation logic.
        // Return early if the value is valid
        // For example:
        if ($propertyValue === 'isValid') {
            return;
        }

        // Finally, if not valid, add the violation
        $this->context->buildViolation($constraint->message)
                      ->setParameter('{{ string }}', $propertyValue)
                      ->addViolation();
    }
46458
public function validate($location, Constraint $constraint)
    {
        if (null === $location) {
            return;
        }

        $isWithinCopySubtreeLimit = new IsWithinCopySubtreeLimit($this->copySubtreeLimit, $this->searchService);
        try {
            if (!$isWithinCopySubtreeLimit->isSatisfiedBy($location)) {
                $this
                    ->context
                    ->buildViolation($constraint->message)
                    ->setParameter('%currentLimit%', $this->copySubtreeLimit)
                    ->addViolation();
            }
        } catch (InvalidArgumentException $e) {
            $this->context->addViolation($e->getMessage());
        }
    }
1197008
public function validate($value, Constraint $constraint)
    {
        if(!$this->isValidNick($value)){
            $this->context->addViolation(
                $constraint->message,
                array('%nickValue%' => $value)
            );
        }
    }
554126
public function visitMinimumDateTimeConstraint(DateTimeValue\MinimumDateTimeConstraint $constraint)
    {
        return sprintf(
            'The date-time value must not be before %s.',
            var_export($constraint->minimum()->format('c'), true)
        );
    }
1139108
protected function validateMaxColumns($columnsSizes, Constraint $constraint)
    {
        if (null !== $constraint->maxColumns) {
            if (!ctype_digit((string) $constraint->maxColumns)) {
                throw new ConstraintDefinitionException(
                    sprintf(
                        '"%s" is not a valid column size',
                        $constraint->maxColumns
                    )
                );
            }

            foreach ($columnsSizes as $size => $occurrences) {
                if ($size > $constraint->maxColumns) {
                    $this->context->addViolation(
                        $constraint->maxColumnsMessage,
                        array(
                            '{{ max_columns }}' => $constraint->maxColumns,
                            '{{ occurrences }}' => implode(',', $occurrences)
                        )
                    );

                    return true;
                }
            }
        }
    }
896248
public function visitIpv4AddressFormatConstraint(StringValue\Ipv4AddressFormatConstraint $constraint)
    {
        if (!$this->formatValidationEnabled()) {
            return $this->createResult();
        }

        $value = $this->currentValue();
        if (
            !$value instanceof Value\StringValue ||
            $this->ipv4AddressValidator()->isValid($value->value())
        ) {
            return $this->createResult();
        }

        return $this->createSingleIssueResult($constraint);
    }
102204
public function getConstrainedRows($constraint)
	{
		$this->related->select($this->related->getQualifiedFieldName('*'));

		return $this->getConstrained($constraint);
	}
1058258
public function validate($value, Constraint $constraint)
    {
        if ($value === null) {
            return;
        }

        if (!$constraint instanceof Range) {
            throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Range');
        }

        if ($value instanceof \DateTime || $value instanceof \DateTimeInterface) {
            $newValue = clone $value;
            $newValue->setTime(0, 0, 0);
            $value = $newValue;
        }

        if (is_array($constraint->min)) {
            if (!(array_key_exists('service', $constraint->min) && array_key_exists('method', $constraint->min))) {
                throw new ConstraintDefinitionException(sprintf('The value of the option "min" as a factory expects the keys "service" and "method".'));
            }

            $minFactory = array($this->container->get($constraint->min['service']), $constraint->min['method']);
            if (!is_callable($minFactory)) {
                throw new ConstraintDefinitionException(sprintf('"%s::%s" targeted by Range constraint is not a valid callable.', get_class($minFactory[0]), $minFactory[1]));
            }

            $min = call_user_func($minFactory);
            if ($min instanceof \DateTime || $min instanceof \DateTimeInterface) {
                $constraint->min = clone $min;
            } else {
                $constraint->min = $min;
            }
        }

        if (is_array($constraint->max)) {
            if (!(array_key_exists('service', $constraint->max) && array_key_exists('method', $constraint->max))) {
                throw new ConstraintDefinitionException(sprintf('The value of the option "max" as a factory expects the keys "service" and "method".'));
            }

            $maxFactory = array($this->container->get($constraint->max['service']), $constraint->max['method']);
            if (!is_callable($maxFactory)) {
                throw new ConstraintDefinitionException(sprintf('"%s::%s" targeted by Range constraint is not a valid callable.', get_class($maxFactory[0]), $maxFactory[1]));
            }

            $max = call_user_func($maxFactory);
            if ($max instanceof \DateTime || $max instanceof \DateTimeInterface) {
                $constraint->max = clone $max;
            } else {
                $constraint->max = $max;
            }
        }

        return parent::validate($value, $constraint);
    }
13642
public function visitDependencyConstraint(ObjectValue\DependencyConstraint $constraint)
    {
        $value = $this->currentValue();
        if (
            !$value instanceof Value\ObjectValue ||
            !$value->has($constraint->property())
        ) {
            return $this->createResult();
        }

        return $constraint->schema()->accept($this);
    }