Code Duplication    Length = 8-10 lines in 4 locations

src/Yandex/DataSync/DataSyncClient.php 4 locations

@@ 383-390 (lines=8) @@
380
     * @throws UnauthorizedException
381
     * @throws UnavailableResourceException
382
     */
383
    public function createDatabase($databaseId = null, $context = null, $fields = [])
384
    {
385
        $response            = $this->sendRequest('PUT', $this->getDatabaseUrl($databaseId, $context, $fields));
386
        $decodedResponseBody = $this->getDecodedBody($response->getBody());
387
        $database            = new Database($decodedResponseBody);
388
        $database->setContext($this->getContext());
389
        return $database;
390
    }
391
392
    /**
393
     * @param null|string $databaseId
@@ 408-415 (lines=8) @@
405
     * @throws UnauthorizedException
406
     * @throws UnavailableResourceException
407
     */
408
    public function getDatabase($databaseId = null, $context = null, $fields = [])
409
    {
410
        $response            = $this->sendRequest('GET', $this->getDatabaseUrl($databaseId, $context, $fields));
411
        $decodedResponseBody = $this->getDecodedBody($response->getBody());
412
        $database            = new Database($decodedResponseBody);
413
        $database->setContext($this->getContext());
414
        return $database;
415
    }
416
417
    /**
418
     * @param null|string $databaseId
@@ 488-497 (lines=10) @@
485
     * @throws UnauthorizedException
486
     * @throws UnavailableResourceException
487
     */
488
    public function getDatabaseSnapshot($databaseId = null, $context = null, $collectionId = null, $fields = [])
489
    {
490
        $response            = $this->sendRequest(
491
            'GET',
492
            $this->getDatabaseSnapshotUrl($databaseId, $context, $collectionId, $fields)
493
        );
494
        $decodedResponseBody = $this->getDecodedBody($response->getBody());
495
        $result              = new DatabaseSnapshotResponse($decodedResponseBody);
496
        return $result;
497
    }
498
499
    /**
500
     * @param array       $data
@@ 567-576 (lines=10) @@
564
     * @throws UnauthorizedException
565
     * @throws UnavailableResourceException
566
     */
567
    public function getDelta($baseRevision = 0, $databaseId = null, $context = null, $fields = [], $limit = null)
568
    {
569
        $response            = $this->sendRequest(
570
            'GET',
571
            $this->getDatabaseDeltasUrl($databaseId, $context, $fields, $baseRevision, $limit)
572
        );
573
        $decodedResponseBody = $this->getDecodedBody($response->getBody());
574
        $result              = new DatabaseDeltasResponse($decodedResponseBody);
575
        return $result;
576
    }
577
}
578