Deprecated: Constant E_STRICT is deprecated in /home/pastorz/old-espace-client/vendor/symfony/error-handler/ErrorHandler.php on line 58
Deprecated: Constant E_STRICT is deprecated in /home/pastorz/old-espace-client/vendor/symfony/error-handler/ErrorHandler.php on line 76 Symfony Profiler
throw new ConstraintDefinitionException(sprintf('No default option is configured for constraint "%s".', static::class));
}
if (\array_key_exists($defaultOption, $knownOptions)) {
$normalizedOptions[$defaultOption] = $options;
unset($missingOptions[$defaultOption]);
} else {
$invalidOptions[] = $defaultOption;
}
}
if (\count($invalidOptions) > 0) {
throw new InvalidOptionsException(sprintf('The options "%s" do not exist in constraint "%s".', implode('", "', $invalidOptions), static::class), $invalidOptions);
}
if (\count($missingOptions) > 0) {
throw new MissingOptionsException(sprintf('The options "%s" must be set for constraint "%s".', implode('", "', array_keys($missingOptions)), static::class), array_keys($missingOptions));
}
return $normalizedOptions;
}
/**
* Sets the value of a lazily initialized option.
*
* Corresponding properties are added to the object on first access. Hence
* this method will be called at most once per constraint instance and
* option name.
*
* @param mixed $value The value to set
*
* @throws InvalidOptionsException If an invalid option name is given
*/
public function __set(string $option, $value)
{
if ('groups' === $option) {
$this->groups = (array) $value;
return;
}
throw new InvalidOptionsException(sprintf('The option "%s" does not exist in constraint "%s".', $option, static::class), [$option]);
}
/**
* Returns the value of a lazily initialized option.
*
* Corresponding properties are added to the object on first access. Hence
* this method will be called at most once per constraint instance and
* option name.
*
* @return mixed
*
* @throws InvalidOptionsException If an invalid option name is given
*/
public function __get(string $option)
{
if ('groups' === $option) {
$this->groups = [self::DEFAULT_GROUP];
return $this->groups;
}
throw new InvalidOptionsException(sprintf('The option "%s" does not exist in constraint "%s".', $option, static::class), [$option]);
}
/**
* @return bool
*/
public function __isset(string $option)
{
return 'groups' === $option;
}
/**
* Adds the given group if this constraint is in the Default group.
*/
public function addImplicitGroupName(string $group)
{
if (null === $this->groups && \array_key_exists('groups', (array) $this)) {
throw new \LogicException(sprintf('"%s::$groups" is set to null. Did you forget to call "%s::__construct()"?', static::class, self::class));
}
if (\in_array(self::DEFAULT_GROUP, $this->groups) && !\in_array($group, $this->groups)) {
$this->groups[] = $group;
}
}
/**
* Returns the name of the default option.
*
* Override this method to define a default option.
*
* @return string|null
*
* @see __construct()
*/
public function getDefaultOption()
{
return null;
}
/**
* Returns the name of the required options.
*
* Override this method if you want to define required options.
*
* @return string[]
*
* @see __construct()
*/
public function getRequiredOptions()
{
return [];
}
/**
* Returns the name of the class that validates this constraint.
*
* By default, this is the fully qualified name of the constraint class
* suffixed with "Validator". You can override this method to change that
* behavior.
*
* @return string
*/
public function validatedBy()
{
return static::class.'Validator';
}
/**
* Returns whether the constraint can be put onto classes, properties or
* both.
*
* This method should return one or more of the constants
* Constraint::CLASS_CONSTRAINT and Constraint::PROPERTY_CONSTRAINT.
*
* @return string|string[] One or more constant values
*/
public function getTargets()
{
return self::PROPERTY_CONSTRAINT;
}
/**
* Optimizes the serialized value to minimize storage space.