Skip to content

Commit faaf9a4

Browse files
authored
Merge pull request #14 from DangerLifter/master
* fix missed method call in listFiles method
2 parents 51a8f19 + 3bc6e29 commit faaf9a4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Service/DriveApiService.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,6 @@ public function renameResource(string $fileId, string $newName)
256256
*/
257257
public function listFiles(?string $parentId = '', ?bool $includeTrashed = true, ?bool $onlyStarred = false, string $orderBy = 'folder,name', array $extra = []): ?\Google_Service_Drive_FileList
258258
{
259-
$drive = $this->getDrive();
260-
261259
$filters = []; // List of queries for $q variable
262260

263261
if($includeTrashed == false) {
@@ -271,7 +269,7 @@ public function listFiles(?string $parentId = '', ?bool $includeTrashed = true,
271269
}
272270
$q = implode(" and ", $filters);
273271

274-
$res = $drive->files->listFiles(array_merge([
272+
$res = $this->getDrive()->files->listFiles(array_merge([
275273
'q' => $q,
276274
'fields' => "files/*",
277275
'supportsAllDrives' => true,
@@ -314,13 +312,13 @@ public function copyFile(string $fileId, ?string $parentId = null): DriveService
314312
* @param string $name Name to search for
315313
* @param string $parentId
316314
*/
317-
public function find(string $name, string $parentId = ''): ?Google_Service_Drive_FileList
315+
public function find(string $name, string $parentId = ''): ?\Google_Service_Drive_FileList
318316
{
319317
$q = "name = '$name'";
320318
if ($parentId != '') {
321319
$q .= " and parents in '$parentId' ";
322320
}
323-
$res = $this->generateDrive()->files->listFiles([
321+
$res = $this->getDrive()->files->listFiles([
324322
'q' => $q,
325323
'supportsAllDrives' => true
326324
]);

0 commit comments

Comments
 (0)