Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 769f3e8

Browse files
authored
Make sure we give a nice error message if we are trying to use a clas… (#480)
* Make sure we give a nice error message if we are trying to use a class without their dependencies installed * Typo
1 parent d8786d9 commit 769f3e8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/S3FilesystemV1.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
use League\Flysystem\Config;
1919
use League\Flysystem\Util;
2020

21+
if (!class_exists(AbstractAdapter::class)) {
22+
throw new \LogicException('You cannot use "AsyncAws\Flysystem\S3\S3FilesystemV1" as the "league/flysystem:1.x" package is not installed. Try running "composer require league/flysystem:^1.0".');
23+
}
24+
2125
class S3FilesystemV1 extends AbstractAdapter implements CanOverwriteFiles
2226
{
2327
const PUBLIC_GRANT_URI = 'http://acs.amazonaws.com/groups/global/AllUsers';

src/S3FilesystemV2.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
use League\MimeTypeDetection\FinfoMimeTypeDetector;
3232
use Throwable;
3333

34+
if (!interface_exists(FilesystemAdapter::class)) {
35+
throw new \LogicException('You cannot use "AsyncAws\Flysystem\S3\S3FilesystemV2" as the "league/flysystem:2.x" package is not installed. Try running "composer require league/flysystem:^2.0".');
36+
}
37+
3438
class S3FilesystemV2 implements FilesystemAdapter
3539
{
3640
/**

0 commit comments

Comments
 (0)