Code Duplication    Length = 10-10 lines in 2 locations

src/Form/Field/File.php 2 locations

@@ 331-340 (lines=10) @@
328
     *
329
     * @return array
330
     */
331
    protected function preview()
332
    {
333
        $files = json_decode($this->value, true);
334
335
        if (!is_array($files)) {
336
            $files = [$this->value];
337
        }
338
339
        return array_map([$this, 'buildPreviewItem'], $files);
340
    }
341
342
    /**
343
     * Preview html for file-upload plugin.
@@ 478-487 (lines=10) @@
475
     *
476
     * @return void.
477
     */
478
    public function destroy()
479
    {
480
        $files = json_decode($this->original, true);
481
482
        if (!is_array($files)) {
483
            $files = [$this->original];
484
        }
485
486
        array_map([$this, 'destroyItem'], $files);
487
    }
488
489
    /**
490
     * Destroy single original file.