Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 55-59 (lines=5) @@
52
    {
53
        $newFiledir = Configure::read('ContentsFile.Setting.Normal.fileDir') . $attachmentSaveData['model'] . '/' . $attachmentSaveData['model_id'] . '/';
54
        // ランダムパスの場合の分岐
55
        if (Configure::read('ContentsFile.Setting.randomFile') === true) {
56
            $newFilepath = $newFiledir . $attachmentSaveData['file_random_path'];
57
        } else {
58
            $newFilepath = $newFiledir . $fileInfo['field_name'];
59
        }
60
61
        //元ファイルは削除する
62
        $this->normalFileDelete($attachmentSaveData['model'], $attachmentSaveData['model_id'], $fileInfo['field_name']);

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

@@ 67-71 (lines=5) @@
64
    {
65
        $S3 = new S3();
66
        $newFiledir = Configure::read('ContentsFile.Setting.S3.fileDir') . $attachmentSaveData['model'] . '/' . $attachmentSaveData['model_id'] . '/';
67
        if (Configure::read('ContentsFile.Setting.randomFile') === true) {
68
            $newFilepath = $newFiledir . $attachmentSaveData['file_random_path'];
69
        } else {
70
            $newFilepath = $newFiledir . $fileInfo['field_name'];
71
        }
72
        $oldFilepath = Configure::read('ContentsFile.Setting.S3.tmpDir') . $fileInfo['tmp_file_name'];
73
74
        // 該当ファイルを消す