Skip to content

Commit 7d66371

Browse files
committed
WIP
1 parent 7289319 commit 7d66371

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/FlysystemCloudinaryAdapter.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ public function read(string $path): string
341341
$path = $this->ensureFolderIsPrefixed(trim($path, '/'));
342342

343343
try {
344-
$contents = file_get_contents(Media::fromParams($path));
344+
$contents = file_get_contents(Media::fromParams($path, []));
345345
} catch (Exception) {
346346
$contents = '';
347347
}
@@ -488,6 +488,7 @@ private function getMetadata(string $path, string $type): FileAttributes
488488

489489
$attributes = $this->mapToFileAttributes($result);
490490

491+
// @phpstan-ignore-next-line
491492
if (! $attributes instanceof FileAttributes) {
492493
throw UnableToRetrieveMetadata::create($path, $type);
493494
}
@@ -688,11 +689,11 @@ public function directoryExists(string $path): bool
688689
do {
689690
$response = (array) $this->cloudinary->adminApi()->subFolders($needle, [
690691
'max_results' => 4,
691-
'next_cursor' => isset($response['next_cursor']) ? $response['next_cursor'] : null, /** @phpstan-ignore-line */
692+
'next_cursor' => $response['next_cursor'] ?? null,
692693
]);
693694

694-
$folders = array_merge($folders, $response['folders']); /** @phpstan-ignore-line */
695-
} while (array_key_exists('next_cursor', $response) && ! is_null($response['next_cursor'])); /** @phpstan-ignore-line */
695+
$folders = array_merge($folders, $response['folders']);
696+
} while (array_key_exists('next_cursor', $response) && ! is_null($response['next_cursor']));
696697
$folders_found = array_filter(
697698
$folders,
698699
function ($e) use ($path) {

0 commit comments

Comments
 (0)