$this->invalidDateTimeMessage =
$invalidDateTimeMessage ??
$this->invalidDateTimeMessage;
$this->min =
$min ??
$this->min;
$this->minPropertyPath =
$minPropertyPath ??
$this->minPropertyPath;
$this->max =
$max ??
$this->max;
$this->maxPropertyPath =
$maxPropertyPath ??
$this->maxPropertyPath;
if (null ===
$this->min && null ===
$this->minPropertyPath && null ===
$this->max && null ===
$this->maxPropertyPath
) { throw new MissingOptionsException(sprintf('Either option "min", "minPropertyPath", "max" or "maxPropertyPath" must be given for constraint "%s".', __CLASS__
),
['min', 'minPropertyPath', 'max', 'maxPropertyPath'
]);
} if (null !==
$this->min && null !==
$this->minPropertyPath
) { throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires only one of the "min" or "minPropertyPath" options to be set, not both.',
static::
class));
} if (null !==
$this->max && null !==
$this->maxPropertyPath
) { throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires only one of the "max" or "maxPropertyPath" options to be set, not both.',
static::
class));
} if ((null !==
$this->minPropertyPath || null !==
$this->maxPropertyPath
) && !
class_exists(PropertyAccess::
class)) { throw new LogicException(sprintf('The "%s" constraint requires the Symfony PropertyAccess component to use the "minPropertyPath" or "maxPropertyPath" option. Try running "composer require symfony/property-access".',
static::
class));
} if (null !==
$this->min && null !==
$this->max
&& ($minMessage ||
$maxMessage)) {