Code Duplication    Length = 4-4 lines in 2 locations

src/Controller/Component/CsvExportComponent.php 1 location

@@ 119-122 (lines=4) @@
116
    private function _parseCsv($v, $delimiter)
117
    {
118
        //区切り文字・改行・ダブルクオートの時
119
        if (preg_match('/[' . $delimiter . '\\n"]/', $v)) {
120
            $v = str_replace('"', '""', $v);
121
            $v = '"' . $v . '"';
122
        }
123
        return $v;
124
    }
125

src/LargeExport/LargeCsvExport.php 1 location

@@ 123-126 (lines=4) @@
120
        mb_convert_variables($this->settings['export_encoding'], $this->settings['array_encoding'], $lists);
121
        foreach ($lists as $listKey => $list) {
122
            //区切り文字・改行・ダブルクオートの時
123
            if (preg_match('/[' . $this->settings['delimiter'] . '\\n"]/', $list)) {
124
                $list = str_replace('"', '""', $list);
125
                $lists[$listKey] = '"' . $list . '"';
126
            }
127
        }
128
        // カンマ区切り
129
        return implode($this->settings['delimiter'], $lists) . "\r\n";