Code Duplication    Length = 11-12 lines in 2 locations

lib/Sii.php 2 locations

@@ 465-476 (lines=12) @@
462
        $lines = explode("\n", $response);
463
        $n_lines = count($lines);
464
        $data = [];
465
        for ($i=1; $i<$n_lines; $i++) {
466
            $row = str_getcsv($lines[$i], ';', '');
467
            unset($lines[$i]);
468
            if (!isset($row[5]))
469
                continue;
470
            for ($j=0; $j<6; $j++)
471
                $row[$j] = trim($row[$j]);
472
            $row[1] = utf8_decode($row[1]);
473
            $row[4] = strtolower($row[4]);
474
            $row[5] = strtolower($row[5]);
475
            $data[] = $row;
476
        }
477
        return $data;
478
    }
479
@@ 565-575 (lines=11) @@
562
        $lines = explode("\n", $response);
563
        $n_lines = count($lines);
564
        $data = [];
565
        for ($i = 1; $i < $n_lines; $i++) {
566
            $row = str_getcsv($lines[$i], ';', '');
567
            unset($lines[$i]);
568
            for ($j = 0; $j < 6; $j++)
569
                $row[$j] = trim($row[$j]);
570
            $row[1] = utf8_decode($row[1]);
571
            $row[2] = utf8_decode($row[2]);
572
            $row[3] = utf8_decode($row[3]);
573
574
            $data[] = $row;
575
        }
576
577
        return $data;
578
    }