cs: Enable risky rule static_lambda.

This commit is contained in:
Pol Dellaiera
2021-11-30 11:43:34 +01:00
parent a9188355c5
commit 91d12c4a96
111 changed files with 212 additions and 212 deletions

View File

@@ -88,7 +88,7 @@ class CustomFieldType extends AbstractType
'label' => 'Required field',
])
->add('type', HiddenType::class, ['data' => $options['type']])
->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
->addEventListener(FormEvents::PRE_SET_DATA, static function (FormEvent $event) {
$customField = $event->getData();
$form = $event->getForm();

View File

@@ -55,7 +55,7 @@ class CustomFieldsGroupType extends AbstractType
$builder->addEventListener(
FormEvents::POST_SET_DATA,
function (FormEvent $event) use ($customizableEntities, $builder) {
static function (FormEvent $event) use ($customizableEntities, $builder) {
$form = $event->getForm();
$group = $event->getData();

View File

@@ -32,7 +32,7 @@ class JsonCustomFieldToArrayTransformer implements DataTransformerInterface
// @TODO: in the array_map callback, CustomField::getLabel() does not exist. What do we do here?
$customFieldsLablels = array_map(
function ($e) { return $e->getLabel(); },
static function ($e) { return $e->getLabel(); },
$customFields
);

View File

@@ -30,7 +30,7 @@ class ChoicesListType extends AbstractType
'required' => false,
])
->add('slug', HiddenType::class)
->addEventListener(FormEvents::SUBMIT, function (FormEvent $event) {
->addEventListener(FormEvents::SUBMIT, static function (FormEvent $event) {
$form = $event->getForm();
$data = $event->getData();