mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-04 05:44:58 +00:00
cs: Enable risky rule static_lambda
.
This commit is contained in:
@@ -77,7 +77,7 @@ class CustomFieldDate extends AbstractCustomField
|
||||
|
||||
public function buildOptionsForm(FormBuilderInterface $builder)
|
||||
{
|
||||
$validatorFunction = function ($value, ExecutionContextInterface $context) {
|
||||
$validatorFunction = static function ($value, ExecutionContextInterface $context) {
|
||||
try {
|
||||
$date = new DateTime($value);
|
||||
} catch (Exception $e) {
|
||||
@@ -179,7 +179,7 @@ class CustomFieldDate extends AbstractCustomField
|
||||
// add constraints if required
|
||||
if (null !== $options[self::MIN]) {
|
||||
$fieldOptions['constraints'][] = new Callback(
|
||||
function ($timestamp, ExecutionContextInterface $context) use ($options) {
|
||||
static function ($timestamp, ExecutionContextInterface $context) use ($options) {
|
||||
if (null === $timestamp) {
|
||||
return;
|
||||
}
|
||||
@@ -200,7 +200,7 @@ class CustomFieldDate extends AbstractCustomField
|
||||
|
||||
if (null !== $options[self::MAX]) {
|
||||
$fieldOptions['constraints'][] = new Callback(
|
||||
function ($timestamp, ExecutionContextInterface $context) use ($options) {
|
||||
static function ($timestamp, ExecutionContextInterface $context) use ($options) {
|
||||
if (null === $timestamp) {
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user