Code Duplication    Length = 14-16 lines in 3 locations

src/Dropbox/Dropbox.php 3 locations

@@ 494-509 (lines=16) @@
491
     * @link https://www.dropbox.com/developers/documentation/http/documentation#files-create_folder
492
     *
493
     */
494
    public function createFolder($path, $autorename = false)
495
    {
496
        //Path cannot be null
497
        if (is_null($path)) {
498
            throw new DropboxClientException("Path cannot be null.");
499
        }
500
501
        //Create Folder
502
        $response = $this->postToAPI('/files/create_folder', ['path' => $path, 'autorename' => $autorename]);
503
504
        //Fetch the Metadata
505
        $body = $response->getDecodedBody();
506
507
        //Make and Return the Model
508
        return new FolderMetadata($body);
509
    }
510
511
    /**
512
     * Delete a file or folder at the given path
@@ 609-624 (lines=16) @@
606
     * @link https://www.dropbox.com/developers/documentation/http/documentation#files-restore
607
     *
608
     */
609
    public function restore($path, $rev)
610
    {
611
        //Path and Revision cannot be null
612
        if (is_null($path) || is_null($rev)) {
613
            throw new DropboxClientException("Path and Revision cannot be null.");
614
        }
615
616
        //Response
617
        $response = $this->postToAPI('/files/restore', ['path' => $path, 'rev' => $rev]);
618
619
        //Fetch the Metadata
620
        $body = $response->getDecodedBody();
621
622
        //Make and Return the Model
623
        return new FileMetadata($body);
624
    }
625
626
    /**
627
     * Get Copy Reference
@@ 638-651 (lines=14) @@
635
     * @link https://www.dropbox.com/developers/documentation/http/documentation#files-copy_reference-get
636
     *
637
     */
638
    public function getCopyReference($path)
639
    {
640
        //Path cannot be null
641
        if (is_null($path)) {
642
            throw new DropboxClientException("Path cannot be null.");
643
        }
644
645
        //Get Copy Reference
646
        $response = $this->postToAPI('/files/copy_reference/get', ['path' => $path]);
647
        $body = $response->getDecodedBody();
648
649
        //Make and Return the Model
650
        return new CopyReference($body);
651
    }
652
653
    /**
654
     * Save Copy Reference