Code Duplication    Length = 13-14 lines in 4 locations

src/Adapter/DropboxAdapter.php 4 locations

@@ 78-90 (lines=13) @@
75
    /**
76
     * {@inheritdoc}
77
     */
78
    public function copy($path, $newpath)
79
    {
80
        $path = $this->applyPathPrefix($path);
81
        $newpath = $this->applyPathPrefix($newpath);
82
83
        try {
84
            $this->client->copy($path, $newpath);
85
86
            return true;
87
        } catch (\Exception $e) {
88
            return false;
89
        }
90
    }
91
92
    /**
93
     * {@inheritdoc}
@@ 119-132 (lines=14) @@
116
    /**
117
     * {@inheritdoc}
118
     */
119
    public function createDir($dirname, Config $config)
120
    {
121
        $path = $this->applyPathPrefix($dirname);
122
        $response = false;
123
124
        try {
125
            $object = $this->client->createFolder($path);
126
127
            $response = $this->normalizeResponse($object);
128
        } catch (\Exception $e) {
129
        }
130
131
        return $response;
132
    }
133
134
    /**
135
     * {@inheritdoc}
@@ 200-213 (lines=14) @@
197
    /**
198
     * {@inheritdoc}
199
     */
200
    public function getMetadata($path)
201
    {
202
        $path = $this->applyPathPrefix($path);
203
204
        try {
205
            $object = $this->client->getMetadata($path);
206
207
            return $this->normalizeResponse($object);
208
        } catch (\Exception  $e) {
209
            return false;
210
        }
211
    }
212
213
    /**
214
     * {@inheritdoc}
215
     */
216
    public function getSize($path)
@@ 280-293 (lines=14) @@
277
     *
278
     * @return array|false file metadata
279
     */
280
    protected function upload($path, $contents, $mode)
281
    {
282
        $path = $this->applyPathPrefix($path);
283
284
        try {
285
            $object = $this->client->upload($path, $contents, $mode);
286
287
            return $this->normalizeResponse($object);
288
        } catch (\Exception $e) {
289
            return false;
290
        }
291
    }
292
}
293