Code Duplication    Length = 10-12 lines in 2 locations

src/Form/Field/Image.php 1 location

@@ 28-39 (lines=12) @@
25
     *
26
     * @return string
27
     */
28
    public function prepare($image)
29
    {
30
        if (request()->has(static::FILE_DELETE_FLAG)) {
31
            return $this->destroy();
32
        }
33
34
        $this->name = $this->getStoreName($image);
35
36
        $this->callInterventionMethods($image->getRealPath());
37
38
        return $this->uploadAndDeleteOriginal($image);
39
    }
40
}
41

src/Form/Field/File.php 1 location

@@ 102-111 (lines=10) @@
99
     *
100
     * @return mixed|string
101
     */
102
    public function prepare($file)
103
    {
104
        if (request()->has(static::FILE_DELETE_FLAG)) {
105
            return $this->destroy();
106
        }
107
108
        $this->name = $this->getStoreName($file);
109
110
        return $this->uploadAndDeleteOriginal($file);
111
    }
112
113
    /**
114
     * Upload file and delete original file.