Code Duplication    Length = 3-3 lines in 2 locations

system/modules/Exchange1c/objects/Parser/Item/Images.php 1 location

@@ 23-25 (lines=3) @@
20
        $dir = pathinfo($this->reader->source, PATHINFO_DIRNAME);
21
        foreach ($this->object->model->images as $image) {
22
            $file = $image->file;
23
            if ($file && $value && file_exists($dir . '/' . $value) && file_exists(\App::$primary->path . $file->path) && md5_file($dir . '/' . $value) == md5_file(\App::$primary->path . $file->path)) {
24
                $notEq = false;
25
            }
26
        }
27
        if ($notEq) {
28
            $file_id = \App::$primary->files->uploadFromUrl($dir . '/' . $value, ['accept_group' => 'image', 'upload_code' => 'MigrationUpload']);

system/modules/Migrations/objects/Parser/Object/Value.php 1 location

@@ 75-77 (lines=3) @@
72
                $dir = pathinfo($this->reader->source, PATHINFO_DIRNAME);
73
                if ($this->model->{$this->param->value}) {
74
                    $file = \Files\File::get($this->model->{$this->param->value});
75
                    if ($file && $value && file_exists($dir . '/' . $value) && file_exists(\App::$primary->path . $file->path) && md5_file($dir . '/' . $value) == md5_file(\App::$primary->path . $file->path)) {
76
                        $notEq = false;
77
                    }
78
                    if ($file && $notEq) {
79
                        $file->delete();
80
                        $this->model->{$this->param->value} = 0;