Code Duplication    Length = 8-10 lines in 4 locations

src/Yandex/DataSync/DataSyncClient.php 4 locations

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