Code Duplication    Length = 19-19 lines in 2 locations

src/Gaufrette/Adapter/AsyncAwsS3.php 1 location

@@ 209-227 (lines=19) @@
206
    /**
207
     * {@inheritdoc}
208
     */
209
    public function listKeys($prefix = '')
210
    {
211
        $this->ensureBucketExists();
212
213
        $options = ['Bucket' => $this->bucket];
214
        if ((string) $prefix != '') {
215
            $options['Prefix'] = $this->computePath($prefix);
216
        } elseif (!empty($this->options['directory'])) {
217
            $options['Prefix'] = $this->options['directory'];
218
        }
219
220
        $keys = [];
221
        $result = $this->service->listObjectsV2($options);
222
        foreach ($result->getContents() as $file) {
223
            $keys[] = $this->computeKey($file->getKey());
224
        }
225
226
        return $keys;
227
    }
228
229
    /**
230
     * {@inheritdoc}

src/Gaufrette/Adapter/AwsS3.php 1 location

@@ 196-214 (lines=19) @@
193
    /**
194
     * {@inheritdoc}
195
     */
196
    public function listKeys($prefix = '')
197
    {
198
        $this->ensureBucketExists();
199
200
        $options = ['Bucket' => $this->bucket];
201
        if ((string) $prefix != '') {
202
            $options['Prefix'] = $this->computePath($prefix);
203
        } elseif (!empty($this->options['directory'])) {
204
            $options['Prefix'] = $this->options['directory'];
205
        }
206
207
        $keys = [];
208
        $iter = $this->service->getIterator('ListObjects', $options);
209
        foreach ($iter as $file) {
210
            $keys[] = $this->computeKey($file['Key']);
211
        }
212
213
        return $keys;
214
    }
215
216
    /**
217
     * {@inheritdoc}