Skip to content

Commit

Permalink
Merge pull request #134 from mhl2014/2.x
Browse files Browse the repository at this point in the history
Minor repairs
  • Loading branch information
masbug authored Oct 22, 2024
2 parents b2ed8b5 + 66ea053 commit 9908278
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
9 changes: 5 additions & 4 deletions src/GoogleDriveAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use League\Flysystem\Visibility;
use League\MimeTypeDetection\FinfoMimeTypeDetector;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamInterface;
use Throwable;

Expand Down Expand Up @@ -550,7 +551,7 @@ public function copy(string $location, string $destination, Config $config): voi
return;
}

throw UnableToCopyFile::fromLocationTo($path, $newpath, 'Unable To Copy File');
throw UnableToCopyFile::fromLocationTo($path, $newpath);
}

/**
Expand All @@ -560,7 +561,7 @@ public function copy(string $location, string $destination, Config $config): voi
public function move(string $source, string $destination, Config $config): void
{
if (!$this->fileExists($source)) {
throw UnableToMoveFile::fromLocationTo($source, $destination, new Exception("File {$source} not exist."));
throw UnableToMoveFile::fromLocationTo($source, $destination);
}
try {
$this->refreshToken();
Expand Down Expand Up @@ -768,7 +769,7 @@ public function read(string $location): string
} else {
[, $fileId] = $this->splitPath($path);
}
/** @var RequestInterface $response */
/** @var ResponseInterface $response */
if (($response = $this->service->files->get(/** @scrutinizer ignore-type */ $fileId, $this->applyDefaultParams(['alt' => 'media'], 'files.get')))) {
return (string)$response->getBody();
}
Expand Down Expand Up @@ -950,7 +951,7 @@ private function fileAttributes(string $path, string $type = ''): FileAttributes

if (!isset($fileAttributes) || !$fileAttributes instanceof FileAttributes) {
if (!$type) {
throw UnableToRetrieveMetadata::create($path, '', $exception);
throw UnableToRetrieveMetadata::create($path, '', '', $exception);
} else {
throw UnableToRetrieveMetadata::$type($path, '', $exception);
}
Expand Down
10 changes: 0 additions & 10 deletions tests/GoogleDriveAdapterTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ class GoogleDriveAdapterTests extends FilesystemAdapterTestCase
{
protected $exceptionTypeToRetryOn = null;

/**
* @var string
*/
private static $adapterPrefix = 'ci';

public static function setUpBeforeClass(): void
{
static::$adapterPrefix = 'ci/'.bin2hex(random_bytes(10));
}

protected function retryOnException(string $className, int $timout = 2): void
{
$this->exceptionTypeToRetryOn = null;
Expand Down

0 comments on commit 9908278

Please sign in to comment.