Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 112-116 (lines=5) @@
109
        if (empty($attachmentData)) {
110
            return false;
111
        }
112
        if (Configure::read('ContentsFile.Setting.randomFile') === true && $attachmentData->file_random_path != '') {
113
            $deleteField = $attachmentData->file_random_path;
114
        } else {
115
            $deleteField = $attachmentData->field_name;
116
        }
117
118
        // リサイズのディレクトリ
119
        $resizeDir = Configure::read('ContentsFile.Setting.Normal.fileDir') . $modelName . '/' . $modelId . '/' . 'contents_file_resize_' . $deleteField . '/';

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

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