| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace League\Flysystem; |
| 6 |
|
| 7 |
use LogicException; |
| 8 |
|
| 9 |
class UnableToMountFilesystem extends LogicException implements FilesystemException |
| 10 |
{ |
| 11 |
/** |
| 12 |
* @param mixed $key |
| 13 |
*/ |
| 14 |
public static function becauseTheKeyIsNotValid($key): UnableToMountFilesystem |
| 15 |
{ |
| 16 |
return new UnableToMountFilesystem( |
| 17 |
'Unable to mount filesystem, key was invalid. String expected, received: ' . gettype($key) |
| 18 |
); |
| 19 |
} |
| 20 |
|
| 21 |
/** |
| 22 |
* @param mixed $filesystem |
| 23 |
*/ |
| 24 |
public static function becauseTheFilesystemWasNotValid($filesystem): UnableToMountFilesystem |
| 25 |
{ |
| 26 |
$received = is_object($filesystem) ? get_class($filesystem) : gettype($filesystem); |
| 27 |
|
| 28 |
return new UnableToMountFilesystem( |
| 29 |
'Unable to mount filesystem, filesystem was invalid. Instance of ' . FilesystemOperator::class . ' expected, received: ' . $received |
| 30 |
); |
| 31 |
} |
| 32 |
} |
| 33 |
|