Code Duplication    Length = 8-8 lines in 2 locations

src/AbstractZohoDao.php 2 locations

@@ 471-478 (lines=8) @@
468
                $response = $this->zohoClient->insertRecords($this->getModule(), $xmlData, $wfTrigger, $duplicateCheck, $isApproval);
469
                $records = array_merge($records, $response->getRecords());
470
            }
471
        } else {
472
            // We can't pass more than 100 records to Zoho, so we split the request into pieces of 100
473
            foreach (array_chunk($beans, 100) as $beanPool) {
474
                $xmlData = $this->toXml($beanPool);
475
                $response = $this->zohoClient->insertRecords($this->getModule(), $xmlData, $wfTrigger, $duplicateCheck, $isApproval);
476
                $records = array_merge($records, $response->getRecords());
477
            }
478
        }
479
        if (count($records) != count($beans)) {
480
            throw new ZohoCRMException('Error while inserting beans in Zoho. '.count($beans).' passed in parameter, but '.count($records).' returned.');
481
        }
@@ 525-532 (lines=8) @@
522
                $response = $this->zohoClient->updateRecords($this->getModule(), $xmlData, $bean->getZohoId(), $wfTrigger);
523
                $records = array_merge($records, $response->getRecords());
524
            }
525
        } else {
526
            // We can't pass more than 100 records to Zoho, so we split the request into pieces of 100
527
            foreach (array_chunk($beans, 100) as $beanPool) {
528
                $xmlData = $this->toXml($beanPool);
529
                $response = $this->zohoClient->updateRecords($this->getModule(), $xmlData, null, $wfTrigger);
530
                $records = array_merge($records, $response->getRecords());
531
            }
532
        }
533
        if (count($records) != count($beans)) {
534
            throw new ZohoCRMException('Error while inserting beans in Zoho. '.count($beans).' passed in parameter, but '.count($records).' returned.');
535
        }