Code Duplication    Length = 5-5 lines in 2 locations

src/OneDriveAdapter.php 2 locations

@@ 145-149 (lines=5) @@
142
        $patch = explode('/', $dirname);
143
        $sliced = implode('/', array_slice($patch, 0, -1));
144
145
        if (empty($sliced) && $this->usePath) {
146
            $endpoint = str_replace(':/', '', $this->getPathPrefix()).'/children';
147
        } else {
148
            $endpoint = $this->applyPathPrefix($sliced).($this->usePath ? ':' : '').'/children';
149
        }
150
151
        try {
152
            $response = $this->graph->createRequest('POST', $endpoint)
@@ 214-218 (lines=5) @@
211
     */
212
    public function listContents($directory = '', $recursive = false): array
213
    {
214
        if ($directory === '' && $this->usePath) {
215
            $endpoint = str_replace(':/', '', $this->getPathPrefix()).'/children';
216
        } else {
217
            $endpoint = $this->applyPathPrefix($directory).($this->usePath ? ':' : '').'/children';
218
        }
219
220
        try {
221
            $results = [];