In Symfony 7.3 a deprecation is triggered Passing an array of options to configure the \"FOS\\RestBundle\\Validator\\Constraints\\Regex\" constraint is deprecated, use named arguments instead.
The code causing the issue:
Controller/Annotations/AbstractScalarParam.php lines 44 to 51 and 53 to 56
$constraints[] = new Regex([
'pattern' => '#^(?:'.$this->requirements.')$#xsu',
'message' => sprintf(
'Parameter \'%s\' value, does not match requirements \'%s\'',
$this->getName(),
$this->requirements
),
]);
} elseif (is_array($this->requirements) && isset($this->requirements['rule']) && $this->requirements['error_message']) {
$constraints[] = new Regex([
'pattern' => '#^(?:'.$this->requirements['rule'].')$#xsu',
'message' => $this->requirements['error_message'],
]);
The proposed fix:
$constraints[] = new Regex(
'#^(?:'.$this->requirements.')$#xsu',
sprintf(
'Parameter \'%s\' value, does not match requirements \'%s\'',
$this->getName(),
$this->requirements
),
);
} elseif (is_array($this->requirements) && isset($this->requirements['rule']) && $this->requirements['error_message']) {
$constraints[] = new Regex(
'#^(?:'.$this->requirements['rule'].')$#xsu',
$this->requirements['error_message'],
);