diff --git a/CHANGELOG.md b/CHANGELOG.md index effaf8c..6e732e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,5 +21,8 @@ All notable changes to `flysystem-gitlab-storage` will be documented in this fil ### 1.0.4 - 2019-08-03 - Added support for tree path with multiple sub folders. -### 1.0.5- 2019-08-03 +### 1.0.5 - 2019-08-03 - Adapters read method now returns an array instead of raw content. + +### 1.0.6 - 2019-08-03 +- Adapters listContents method now changes type blob to type file. diff --git a/src/GitlabAdapter.php b/src/GitlabAdapter.php index 6f92160..0e78de5 100644 --- a/src/GitlabAdapter.php +++ b/src/GitlabAdapter.php @@ -258,7 +258,13 @@ public function readStream($path) public function listContents($directory = '', $recursive = false): array { try { - return $this->client->tree($this->applyPathPrefix($directory), $recursive); + $res = $this->client->tree($this->applyPathPrefix($directory), $recursive); + + return array_map(function($item) { + $item['type'] = ($item['type'] === 'blob') ? 'file' : $item['type']; + + return $item; + }, $res); } catch (GuzzleException $e) { return []; }