Code Duplication    Length = 17-18 lines in 2 locations

src/Dropbox/Dropbox.php 2 locations

@@ 327-343 (lines=17) @@
324
     *
325
     * @return \Kunnu\Dropbox\Models\MetadataCollection
326
     */
327
    public function listFolder(string $path = '', array $params = [])
328
    {
329
        //Specify the root folder as an
330
        //empty string rather than as "/"
331
        if ($path === '/') {
332
            $path = "";
333
        }
334
335
        //Set the path
336
        $params['path'] = $path;
337
338
        //Get File Metadata
339
        $response = $this->postToAPI('/files/list_folder', $params);
340
341
        //Make and Return the Model
342
        return $this->makeModelFromResponse($response);
343
    }
344
345
    /**
346
     * Paginate through all files and retrieve updates to the folder,
@@ 450-467 (lines=18) @@
447
     *
448
     * @return \Kunnu\Dropbox\Models\SearchResults
449
     */
450
    public function search(string $path = '', $query, array $params = [])
451
    {
452
        //Specify the root folder as an
453
        //empty string rather than as "/"
454
        if ($path === '/') {
455
            $path = "";
456
        }
457
458
        //Set the path and query
459
        $params['path'] = $path;
460
        $params['query'] = $query;
461
462
        //Fetch Search Results
463
        $response = $this->postToAPI('/files/search', $params);
464
465
        //Make and Return the Model
466
        return $this->makeModelFromResponse($response);
467
    }
468
469
    /**
470
     * Create a folder at the given path