Code Duplication    Length = 5-5 lines in 2 locations

src/Model/Behavior/Traits/NormalContentsFileBehaviorTrait.php 1 location

@@ 104-108 (lines=5) @@
101
        if (empty($attachmentData)) {
102
            return false;
103
        }
104
        if (Configure::read('ContentsFile.Setting.randomFile') === true && $attachmentData->file_random_path != '') {
105
            $deleteField = $attachmentData->file_random_path;
106
        } else {
107
            $deleteField = $attachmentData->field_name;
108
        }
109
110
        // リサイズのディレクトリ
111
        $resizeDir = Configure::read('ContentsFile.Setting.Normal.fileDir') . $modelName . '/' . $modelId . '/' . 'contents_file_resize_' . $deleteField . '/';

src/Model/Behavior/Traits/S3ContentsFileBehaviorTrait.php 1 location

@@ 117-121 (lines=5) @@
114
        if (empty($attachmentData)) {
115
            return false;
116
        }
117
        if (Configure::read('ContentsFile.Setting.randomFile') === true && $attachmentData->file_random_path != '') {
118
            $deleteField = $attachmentData->file_random_path;
119
        } else {
120
            $deleteField = $attachmentData->field_name;
121
        }
122
123
       $S3 = new S3();
124
        // リサイズのディレクトリ