Code Duplication    Length = 6-6 lines in 3 locations

main/cron/import_csv.php 3 locations

@@ 2136-2141 (lines=6) @@
2133
            $items = [];
2134
            foreach ($data as $list) {
2135
                $post = [];
2136
                foreach ($list as $key => $value) {
2137
                    $key = (string) trim($key);
2138
                    // Remove utf8 bom
2139
                    $key = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $key);
2140
                    $post[$key] = $value;
2141
                }
2142
2143
                if (empty($post)) {
2144
                    continue;
@@ 2276-2281 (lines=6) @@
2273
            }
2274
2275
            foreach ($data as $row) {
2276
                foreach ($row as $key => $value) {
2277
                    $key = (string)trim($key);
2278
                    // Remove utf8 bom
2279
                    $key = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $key);
2280
                    $row[$key] = $value;
2281
                }
2282
2283
                $itemId = $row['CareerId'];
2284
                $item = $extraFieldValue->get_item_id_from_field_variable_and_field_value(
@@ 2355-2360 (lines=6) @@
2352
            $this->logger->addInfo(count($data)." records found.");
2353
            $values = [];
2354
            foreach ($data as $row) {
2355
                foreach ($row as $key => $value) {
2356
                    $key = (string) trim($key);
2357
                    // Remove utf8 bom
2358
                    $key = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $key);
2359
                    $row[$key] = $value;
2360
                }
2361
                $values[$row['Column']][] = $row;
2362
            }
2363