Skip to content

Commit 470237a

Browse files
committed
Changes method name of ApiInterface::getRecursiveMetadata() to ApiInterface::getTreeMetadata().
1 parent 6c858b5 commit 470237a

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/Api.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ final public function getMetaData($path)
232232
* @return array
233233
* @throws \Github\Exception\InvalidArgumentException
234234
*/
235-
final public function getRecursiveMetadata($path, $recursive)
235+
final public function getTreeMetadata($path, $recursive)
236236
{
237237
// If $info['truncated'] is `true`, the number of items in the tree array
238238
// exceeded the github maximum limit. If we need to fetch more items,

src/ApiInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function getMetaData($path);
4242
*
4343
* @return array
4444
*/
45-
public function getRecursiveMetadata($path, $recursive);
45+
public function getTreeMetadata($path, $recursive);
4646

4747
/**
4848
* @param string $path

src/GithubAdapter.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public function read($path)
187187
*/
188188
public function listContents($path = '/', $recursive = false)
189189
{
190-
$contents = $this->getApi()->getRecursiveMetadata($path, $recursive);
190+
$contents = $this->getApi()->getTreeMetadata($path, $recursive);
191191

192192
if ($this->isDirectoryContents($contents) === false) {
193193
$contents = [];
@@ -254,7 +254,7 @@ public function getTimestamp($path)
254254
public function getVisibility($path)
255255
{
256256
$recursive = false;
257-
$metadata = $this->getApi()->getRecursiveMetadata($path, $recursive);
257+
$metadata = $this->getApi()->getTreeMetadata($path, $recursive);
258258
return $metadata[0];
259259
}
260260

tests/unit-tests/ApiTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -262,15 +262,15 @@ final public function testApiShouldPassOnExceptionsWhenAskingInfoForFileCausesAn
262262
}
263263

264264
/**
265-
* @covers ::getRecursiveMetadata
265+
* @covers ::getTreeMetadata
266266
*
267267
* @uses Potherca\Flysystem\Github\Api::getCreatedTimestamp
268268
*
269269
* @dataProvider provideExpectedMetadata
270270
*
271271
* @param array $data
272272
*/
273-
final public function testApiShouldRetrieveExpectedMetadataWhenAskedToGetRecursiveMetadata($data) {
273+
final public function testApiShouldRetrieveExpectedMetadataWhenAskedToGetTreeMetadata($data) {
274274
$api = $this->api;
275275

276276
$mockVendor = 'vendor';
@@ -291,7 +291,7 @@ final public function testApiShouldRetrieveExpectedMetadataWhenAskedToGetRecursi
291291
Trees::class
292292
);
293293

294-
$actual = $api->getRecursiveMetadata($data['path'], $data['recursive']);
294+
$actual = $api->getTreeMetadata($data['path'], $data['recursive']);
295295

296296
$actual = array_map(function ($value) {
297297
$value['timestamp'] = null;

tests/unit-tests/GithubAdapterTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ final public function provideReadMethods()
6565
return [
6666
['has', 'exists', [self::MOCK_FILE_PATH]],
6767
['read', 'getFileContents', [self::MOCK_FILE_PATH]],
68-
['listContents', 'getRecursiveMetadata', [self::MOCK_FILE_PATH, true]],
68+
['listContents', 'getTreeMetadata', [self::MOCK_FILE_PATH, true]],
6969
['getMetadata', 'getMetadata', [self::MOCK_FILE_PATH]],
7070
['getSize', 'getMetadata', [self::MOCK_FILE_PATH]],
7171
['getMimetype', 'guessMimeType', [self::MOCK_FILE_PATH]],
7272
['getTimestamp', 'getLastUpdatedTimestamp', [self::MOCK_FILE_PATH]],
73-
['getVisibility', 'getRecursiveMetadata', [self::MOCK_FILE_PATH]],
73+
['getVisibility', 'getTreeMetadata', [self::MOCK_FILE_PATH, false]],
7474
];
7575
}
7676
}

0 commit comments

Comments
 (0)