Code Duplication    Length = 16-17 lines in 2 locations

plugins/Field/src/Field/FileField.php 1 location

@@ 71-86 (lines=16) @@
68
    /**
69
     * {@inheritDoc}
70
     */
71
    public function fieldAttached(Field $field)
72
    {
73
        $extra = (array)$field->extra;
74
        if (!empty($extra)) {
75
            $newExtra = [];
76
            foreach ($extra as $file) {
77
                $newExtra[] = array_merge([
78
                    'mime_icon' => '',
79
                    'file_name' => '',
80
                    'file_size' => '',
81
                    'description' => '',
82
                ], (array)$file);
83
            }
84
            $field->set('extra', $newExtra);
85
        }
86
    }
87
88
    /**
89
     * {@inheritDoc}

plugins/Field/src/Field/ImageField.php 1 location

@@ 72-88 (lines=17) @@
69
    /**
70
     * {@inheritDoc}
71
     */
72
    public function fieldAttached(Field $field)
73
    {
74
        $extra = (array)$field->extra;
75
        if (!empty($extra)) {
76
            $newExtra = [];
77
            foreach ($extra as $file) {
78
                $newExtra[] = array_merge([
79
                    'mime_icon' => '',
80
                    'file_name' => '',
81
                    'file_size' => '',
82
                    'title' => '',
83
                    'alt' => '',
84
                ], (array)$file);
85
            }
86
            $field->set('extra', $newExtra);
87
        }
88
    }
89
90
    /**
91
     * {@inheritDoc}