From 2691894b78f9497cace8a0729e150d18f058d866 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Wed, 17 Apr 2024 10:53:59 +0200 Subject: [PATCH] Fixed tests --- .../2024_04_16_233540_add_allowcustom_field.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/database/migrations/2024_04_16_233540_add_allowcustom_field.php b/database/migrations/2024_04_16_233540_add_allowcustom_field.php index 8482422f..3dd007e7 100644 --- a/database/migrations/2024_04_16_233540_add_allowcustom_field.php +++ b/database/migrations/2024_04_16_233540_add_allowcustom_field.php @@ -1,10 +1,8 @@ get() as $event) { $config = json_decode($event->config); $config->sections = array_map(function ($section) { - $section->fields = collect($section->fields)->map(function ($field) { + /** @var Collection */ + $fields = $section->fields; + $section->fields = collect($fields)->map(function ($field) { if ($field->type === 'DropdownField' || $field->type === 'RadioField') { $field->allowcustom = false; } @@ -33,7 +33,9 @@ return new class extends Migration foreach (DB::table('formtemplates')->get() as $event) { $config = json_decode($event->config); $config->sections = array_map(function ($section) { - $section->fields = collect($section->fields)->map(function ($field) { + /** @var Collection */ + $fields = $section->fields; + $section->fields = collect($fields)->map(function ($field) { if ($field->type === 'DropdownField' || $field->type === 'RadioField') { $field->allowcustom = false; }