Code Duplication    Length = 13-16 lines in 3 locations

src/ZohoClient.php 3 locations

@@ 321-336 (lines=16) @@
318
     *
319
     * @throws ZohoCRMResponseException
320
     */
321
    public function insertRecords($module, $xmlData, $wfTrigger = null, $duplicateCheck = null, $isApproval = null, $version = 4, $newFormat = 2)
322
    {
323
        if ($wfTrigger) {
324
            $params['wfTrigger'] = 'true';
325
        }
326
        if ($duplicateCheck) {
327
            $params['duplicateCheck'] = $duplicateCheck;
328
        }
329
        if ($isApproval) {
330
            $params['isApproval'] = 'true';
331
        }
332
        $params['newFormat'] = $newFormat;
333
        $params['version'] = $version;
334
335
        return $this->call($module, 'insertRecords', $params, ['xmlData' => $xmlData->asXML()]);
336
    }
337
338
    /**
339
     * Implements updateRecords API method.
@@ 350-362 (lines=13) @@
347
     *
348
     * @throws ZohoCRMResponseException
349
     */
350
    public function updateRecords($module, $xmlData, $id = null, $wfTrigger = null, $version = 4, $newFormat = 2)
351
    {
352
        $params['newFormat'] = $newFormat;
353
        $params['version'] = $version;
354
        if ($wfTrigger) {
355
            $params['wfTrigger'] = 'true';
356
        }
357
        if ($id) {
358
            $params['id'] = $id;
359
        }
360
361
        return $this->call($module, 'updateRecords', $params, ['xmlData' => $xmlData->asXML()]);
362
    }
363
364
    /**
365
     * Implements updateRelatedRecords API method.
@@ 377-390 (lines=14) @@
374
     *
375
     * @throws ZohoCRMResponseException
376
     */
377
    public function updateRelatedRecords($module, $relatedModule, $xmlData, $id = null, $wfTrigger = null, $version = 4, $newFormat = 2)
378
    {
379
        $params['newFormat'] = $newFormat;
380
        $params['version'] = $version;
381
        $params['relatedModule'] = $relatedModule;
382
        if ($wfTrigger) {
383
            $params['wfTrigger'] = 'true';
384
        }
385
        if ($id) {
386
            $params['id'] = $id;
387
        }
388
389
        return $this->call($module, 'updateRelatedRecords', $params, ['xmlData' => $xmlData->asXML()]);
390
    }
391
392
    /**
393
     * Implements uploadFile API method.