diff --git a/README.md b/README.md index a7738b9..eebbfa1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Storage Factories for Flysystem +[![CI](https://github.com/php-collective/file-storage-factories/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/php-collective/file-storage-factories/actions/workflows/ci.yml) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) In the underlying Flysystem implementation some adapters are more or less complex to build. Sometimes you have to compose multiple objects and feed them to an adapter. The factories take this burden away from you and provide you the same interface for all adapters. Just their config array options differ. diff --git a/composer.json b/composer.json index 8b96bac..831cea4 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "prefer-stable": true, "require": { "php": ">=8.1", - "league/flysystem": "^1.0", + "league/flysystem": "^3.22", "psr/container": "^1.0|^2.0" }, "require-dev": { @@ -38,17 +38,13 @@ "phpstan/phpstan": "^1.10", "php-collective/code-sniffer": "^0.2.1", "instituteweb/composer-scripts": "^1.1", - "league/flysystem-aws-s3-v3": "^1.0.29", - "league/flysystem-azure": "^1.0", - "league/flysystem-azure-blob-storage": "^1.0", - "league/flysystem-gridfs": "^1.0", - "league/flysystem-memory": "^1.0", - "league/flysystem-rackspace": "^1.0", - "league/flysystem-replicate-adapter": "^1.0", - "league/flysystem-sftp": "^1.0", - "league/flysystem-webdav": "^1.0", - "league/flysystem-ziparchive": "^1.0", - "spatie/flysystem-dropbox": "^1.2" + "league/flysystem-aws-s3-v3": "^3.22", + "league/flysystem-azure-blob-storage": "^3.22", + "league/flysystem-memory": "^3.0", + "league/flysystem-sftp": "^3.22", + "league/flysystem-webdav": "^3.21", + "league/flysystem-ziparchive": "^3.21", + "spatie/flysystem-dropbox": "^3.0.1" }, "autoload": { "psr-4": { diff --git a/phpstan.neon b/phpstan.neon index b8ac19b..20fd46b 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,4 +5,3 @@ parameters: checkMissingIterableValueType: false checkGenericClassInNonGenericObjectType: false ignoreErrors: - - '#Call to an undefined static method .+BlobRestProxy::createBlobService\(\).#' diff --git a/src/Adapter/NullFilesystemAdapter.php b/src/Adapter/NullFilesystemAdapter.php new file mode 100644 index 0000000..630aff1 --- /dev/null +++ b/src/Adapter/NullFilesystemAdapter.php @@ -0,0 +1,188 @@ + null, + 'bucket' => '', 'prefix' => '', 'client' => [ 'region' => 'eu', @@ -41,18 +40,17 @@ class AwsS3v3Factory extends AbstractFactory /** * @inheritDoc */ - public function build(array $config): AdapterInterface + public function build(array $config): AwsS3V3Adapter { $this->availabilityCheck(); $config += $this->defaults; - return new AwsS3Adapter( + return new AwsS3V3Adapter( S3Client::factory( $config['client'], ), $config['bucket'], $config['prefix'], - $config, ); } } diff --git a/src/Factories/AzureFactory.php b/src/Factories/AzureFactory.php index 75811d6..e3b9c76 100644 --- a/src/Factories/AzureFactory.php +++ b/src/Factories/AzureFactory.php @@ -14,8 +14,8 @@ namespace PhpCollective\Infrastructure\Storage\Factories; -use League\Flysystem\AdapterInterface; use League\Flysystem\AzureBlobStorage\AzureBlobStorageAdapter; +use League\Flysystem\FilesystemAdapter; use MicrosoftAzure\Storage\Blob\BlobRestProxy; use PhpCollective\Infrastructure\Storage\Factories\Exception\FactoryConfigException; @@ -40,7 +40,7 @@ class AzureFactory extends AbstractFactory /** * @inheritDoc */ - public function build($config): AdapterInterface + public function build($config): FilesystemAdapter { $this->availabilityCheck(); $this->checkConfig($config); @@ -57,7 +57,7 @@ public function build($config): AdapterInterface } /** - * @param array $config + * @param array $config * * @throws \PhpCollective\Infrastructure\Storage\Factories\Exception\FactoryConfigException * diff --git a/src/Factories/DropboxFactory.php b/src/Factories/DropboxFactory.php index f1d67a8..6902cf7 100644 --- a/src/Factories/DropboxFactory.php +++ b/src/Factories/DropboxFactory.php @@ -14,7 +14,7 @@ namespace PhpCollective\Infrastructure\Storage\Factories; -use League\Flysystem\AdapterInterface; +use League\Flysystem\FilesystemAdapter; use Spatie\Dropbox\Client; use Spatie\FlysystemDropbox\DropboxAdapter; @@ -36,7 +36,7 @@ class DropboxFactory extends AbstractFactory /** * @inheritDoc */ - public function build(array $config): AdapterInterface + public function build(array $config): FilesystemAdapter { $config += $this->defaults; $client = new Client($config['authToken']); diff --git a/src/Factories/FactoryInterface.php b/src/Factories/FactoryInterface.php index 23eb090..f68f760 100644 --- a/src/Factories/FactoryInterface.php +++ b/src/Factories/FactoryInterface.php @@ -14,7 +14,7 @@ namespace PhpCollective\Infrastructure\Storage\Factories; -use League\Flysystem\AdapterInterface; +use League\Flysystem\FilesystemAdapter; /** * Factory Interface @@ -34,9 +34,9 @@ public function alias(): string; /** * @param array $config * - * @return \League\Flysystem\AdapterInterface + * @return \League\Flysystem\FilesystemAdapter */ - public function build(array $config): AdapterInterface; + public function build(array $config): FilesystemAdapter; /** * @return void diff --git a/src/Factories/FtpFactory.php b/src/Factories/FtpFactory.php deleted file mode 100644 index 8950491..0000000 --- a/src/Factories/FtpFactory.php +++ /dev/null @@ -1,57 +0,0 @@ - '', - 'username' => '', - 'password' => '', - // Optional settings - 'port' => 21, - 'root' => '/', - 'passive' => true, - 'ssl' => true, - 'timeout' => 30, - 'ignorePassiveAddress' => false, - ]; - - /** - * @inheritDoc - */ - public function build(array $config): AdapterInterface - { - if (!defined('FTP_BINARY')) { - define('FTP_BINARY', 'ftp.exe'); - } - - $config += $this->defaults; - - return new Ftp($config); - } -} diff --git a/src/Factories/LocalFactory.php b/src/Factories/LocalFactory.php index 6f10d65..133eb20 100644 --- a/src/Factories/LocalFactory.php +++ b/src/Factories/LocalFactory.php @@ -14,8 +14,7 @@ namespace PhpCollective\Infrastructure\Storage\Factories; -use League\Flysystem\Adapter\Local; -use League\Flysystem\AdapterInterface; +use League\Flysystem\Local\LocalFilesystemAdapter; /** * LocalFactory @@ -26,19 +25,19 @@ class LocalFactory extends AbstractFactory protected string $package = 'league/flysystem'; - protected string $className = Local::class; + protected string $className = LocalFilesystemAdapter::class; /** - * @param array $config + * @param array $config * - * @return \League\Flysystem\AdapterInterface + * @return \League\Flysystem\Local\LocalFilesystemAdapter */ - public function build(array $config): AdapterInterface + public function build(array $config): LocalFilesystemAdapter { $this->availabilityCheck(); $config += ['root' => '/']; - return new Local($config['root']); + return new LocalFilesystemAdapter($config['root']); } } diff --git a/src/Factories/MemoryFactory.php b/src/Factories/MemoryFactory.php index b5b080c..bcd3bbf 100644 --- a/src/Factories/MemoryFactory.php +++ b/src/Factories/MemoryFactory.php @@ -14,8 +14,8 @@ namespace PhpCollective\Infrastructure\Storage\Factories; -use League\Flysystem\AdapterInterface; -use League\Flysystem\Memory\MemoryAdapter; +use League\Flysystem\FilesystemAdapter; +use League\Flysystem\InMemory\InMemoryFilesystemAdapter; /** * Memory @@ -26,13 +26,13 @@ class MemoryFactory extends AbstractFactory protected string $package = 'league/flysystem-memory'; - protected string $className = MemoryAdapter::class; + protected string $className = InMemoryFilesystemAdapter::class; /** * @inheritDoc */ - public function build(array $config): AdapterInterface + public function build(array $config): FilesystemAdapter { - return new MemoryAdapter(); + return new InMemoryFilesystemAdapter(); } } diff --git a/src/Factories/NullFactory.php b/src/Factories/NullFactory.php index 7ae8ee1..8436216 100644 --- a/src/Factories/NullFactory.php +++ b/src/Factories/NullFactory.php @@ -14,9 +14,8 @@ namespace PhpCollective\Infrastructure\Storage\Factories; -use League\Flysystem\Adapter\NullAdapter; -use League\Flysystem\AdapterInterface; -use League\Flysystem\AwsS3v3\AwsS3Adapter; +use League\Flysystem\FilesystemAdapter; +use PhpCollective\Infrastructure\Storage\Adapter\NullFilesystemAdapter; /** * NullFactory @@ -25,13 +24,13 @@ class NullFactory extends AbstractFactory { protected string $alias = 'null'; - protected string $className = AwsS3Adapter::class; + protected string $className = NullFilesystemAdapter::class; /** * @inheritDoc */ - public function build(array $config): AdapterInterface + public function build(array $config): FilesystemAdapter { - return new NullAdapter(); + return new NullFilesystemAdapter(); } } diff --git a/src/Factories/RackspaceFactory.php b/src/Factories/RackspaceFactory.php deleted file mode 100644 index 2864f36..0000000 --- a/src/Factories/RackspaceFactory.php +++ /dev/null @@ -1,68 +0,0 @@ - Rackspace::UK_IDENTITY_ENDPOINT, - 'username' => '', - 'apiKey' => '', - 'objectStoreService' => 'cloudFiles', - 'serviceRegion' => 'LON', - 'container' => 'flysystem', - 'serviceName' => 'cloudFiles', - ]; - - /** - * @inheritDoc - */ - public function build(array $config): AdapterInterface - { - $config += $this->defaults; - - $client = $this->buildClient($config); - $store = $client->objectStoreService($config['serviceName'], $config['serviceRegion']); - $container = $store->getContainer($config['container']); - - return new RackspaceAdapter($container); - } - - /** - * @param array $config Config - * - * @return \OpenCloud\Rackspace - */ - protected function buildClient(array $config): Rackspace - { - return new Rackspace($config['identityEndpoint'], [ - 'username' => $config['username'], - 'apiKey' => $config['apiKey'], - ]); - } -} diff --git a/src/Factories/ReplicateFactory.php b/src/Factories/ReplicateFactory.php deleted file mode 100644 index ac0a347..0000000 --- a/src/Factories/ReplicateFactory.php +++ /dev/null @@ -1,59 +0,0 @@ - '', - 'port' => 22, - 'username' => '', - 'password' => '', - 'privateKey' => '', - 'passphrase' => '', - 'root' => '/', - 'timeout' => 10, - 'directoryPerm' => 0755, - ]; - - /** - * @inheritDoc - */ - public function build(array $config): AdapterInterface - { - $config += $this->defaults; - - return new SftpAdapter($config); - } -} diff --git a/src/Factories/WebDAVFactory.php b/src/Factories/WebDavFactory.php similarity index 86% rename from src/Factories/WebDAVFactory.php rename to src/Factories/WebDavFactory.php index cb83d20..ebaf297 100644 --- a/src/Factories/WebDAVFactory.php +++ b/src/Factories/WebDavFactory.php @@ -14,14 +14,14 @@ namespace PhpCollective\Infrastructure\Storage\Factories; -use League\Flysystem\AdapterInterface; +use League\Flysystem\FilesystemAdapter; use League\Flysystem\WebDAV\WebDAVAdapter; use Sabre\DAV\Client; /** - * WebdavFactory + * WebDavFactory */ -class WebDAVFactory extends AbstractFactory +class WebDavFactory extends AbstractFactory { protected string $alias = 'webdav'; @@ -39,7 +39,7 @@ class WebDAVFactory extends AbstractFactory /** * @inheritDoc */ - public function build(array $config): AdapterInterface + public function build(array $config): FilesystemAdapter { return new WebDAVAdapter(new Client($config)); } diff --git a/src/Factories/ZipArchiveFactory.php b/src/Factories/ZipArchiveFactory.php index 457299f..b300a38 100644 --- a/src/Factories/ZipArchiveFactory.php +++ b/src/Factories/ZipArchiveFactory.php @@ -14,7 +14,8 @@ namespace PhpCollective\Infrastructure\Storage\Factories; -use League\Flysystem\AdapterInterface; +use League\Flysystem\FilesystemAdapter; +use League\Flysystem\ZipArchive\FilesystemZipArchiveProvider; use League\Flysystem\ZipArchive\ZipArchiveAdapter; /** @@ -31,15 +32,18 @@ class ZipArchiveFactory extends AbstractFactory /** * @inheritDoc */ - public function build(array $config): AdapterInterface + public function build(array $config): FilesystemAdapter { $defaults = [ 'location' => null, - 'archive' => null, - 'prefix' => null, + 'root' => '', + 'mimeTypeDetector' => null, + 'visibility' => null, ]; $config += $defaults; - return new ZipArchiveAdapter($config['location'], $config['archive'], $config['prefix']); + $provider = new FileSystemZipArchiveProvider($config['location']); + + return new ZipArchiveAdapter($provider, $config['root'], $config['mimeTypeDetector'], $config['visibility']); } } diff --git a/src/StorageAdapterFactory.php b/src/StorageAdapterFactory.php index 3489a01..aa621b7 100644 --- a/src/StorageAdapterFactory.php +++ b/src/StorageAdapterFactory.php @@ -14,7 +14,7 @@ namespace PhpCollective\Infrastructure\Storage; -use League\Flysystem\AdapterInterface; +use League\Flysystem\FilesystemAdapter; use PhpCollective\Infrastructure\Storage\Exception\AdapterFactoryNotFoundException; use Psr\Container\ContainerInterface; @@ -42,12 +42,12 @@ public function __construct(?ContainerInterface $container = null) * @param string $adapterClass Adapter alias or classname * @param array $options Options * - * @return \League\Flysystem\AdapterInterface + * @return \League\Flysystem\FilesystemAdapter */ public function buildStorageAdapter( string $adapterClass, array $options - ): AdapterInterface { + ): FilesystemAdapter { /** @var class-string<\PhpCollective\Infrastructure\Storage\Factories\FactoryInterface> $adapterClass */ $adapterClass = $this->checkAndResolveAdapterClass($adapterClass); diff --git a/src/StorageAdapterFactoryInterface.php b/src/StorageAdapterFactoryInterface.php index b91e8ba..47963bf 100644 --- a/src/StorageAdapterFactoryInterface.php +++ b/src/StorageAdapterFactoryInterface.php @@ -14,7 +14,7 @@ namespace PhpCollective\Infrastructure\Storage; -use League\Flysystem\AdapterInterface; +use League\Flysystem\FilesystemAdapter; /** * StorageFactory - Manages and instantiates storage engine adapters. @@ -27,10 +27,10 @@ interface StorageAdapterFactoryInterface * @param string $adapterClass Adapter alias or classname * @param array $options Options array * - * @return \League\Flysystem\AdapterInterface + * @return \League\Flysystem\FilesystemAdapter */ public function buildStorageAdapter( string $adapterClass, array $options - ): AdapterInterface; + ): FilesystemAdapter; } diff --git a/tests/TestCase/Storage/Factories/AbstractFactoryTest.php b/tests/TestCase/Storage/Factories/AbstractFactoryTest.php index 56bda4e..f4f51ab 100644 --- a/tests/TestCase/Storage/Factories/AbstractFactoryTest.php +++ b/tests/TestCase/Storage/Factories/AbstractFactoryTest.php @@ -14,7 +14,8 @@ namespace PhpCollective\Storage\Test\TestCase\Storage\Factories; -use League\Flysystem\AdapterInterface; +use League\Flysystem\FilesystemAdapter; +use League\Flysystem\Local\LocalFilesystemAdapter; use PhpCollective\Infrastructure\Storage\Exception\PackageRequiredException; use PhpCollective\Infrastructure\Storage\Factories\AbstractFactory; use PhpCollective\Storage\Test\TestCase\StorageTestCase as TestCase; @@ -36,12 +37,14 @@ public function testFactory(): void /** * @param array $config * - * @return \League\Flysystem\AdapterInterface + * @return \League\Flysystem\FilesystemAdapter */ - public function build(array $config): AdapterInterface + public function build(array $config): FilesystemAdapter { $this->availabilityCheck(); + $testAdapter = LocalFilesystemAdapter::class; + return new $testAdapter(); } }; diff --git a/tests/TestCase/Storage/Factories/AwsS3v3FactoryTest.php b/tests/TestCase/Storage/Factories/AwsS3v3FactoryTest.php index 3573a2c..b6a4cd3 100644 --- a/tests/TestCase/Storage/Factories/AwsS3v3FactoryTest.php +++ b/tests/TestCase/Storage/Factories/AwsS3v3FactoryTest.php @@ -14,7 +14,7 @@ namespace PhpCollective\Storage\Test\TestCase\Storage\Factories; -use League\Flysystem\AwsS3v3\AwsS3Adapter; +use League\Flysystem\AwsS3V3\AwsS3V3Adapter; use PhpCollective\Infrastructure\Storage\Factories\AwsS3v3Factory; use PhpCollective\Storage\Test\TestCase\StorageTestCase as TestCase; @@ -30,6 +30,6 @@ public function testFactory(): void { $factory = new AwsS3v3Factory(); $adapter = $factory->build([]); - $this->assertInstanceOf(AwsS3Adapter::class, $adapter); + $this->assertInstanceOf(AwsS3V3Adapter::class, $adapter); } } diff --git a/tests/TestCase/Storage/Factories/FtpFactoryTest.php b/tests/TestCase/Storage/Factories/FtpFactoryTest.php deleted file mode 100644 index 1631136..0000000 --- a/tests/TestCase/Storage/Factories/FtpFactoryTest.php +++ /dev/null @@ -1,35 +0,0 @@ -build([]); - $this->assertInstanceOf(Ftp::class, $adapter); - } -} diff --git a/tests/TestCase/Storage/Factories/LocalFactoryTest.php b/tests/TestCase/Storage/Factories/LocalFactoryTest.php index 039539b..c3de095 100644 --- a/tests/TestCase/Storage/Factories/LocalFactoryTest.php +++ b/tests/TestCase/Storage/Factories/LocalFactoryTest.php @@ -14,7 +14,7 @@ namespace PhpCollective\Storage\Test\TestCase\Storage\Factories; -use League\Flysystem\Adapter\Local; +use League\Flysystem\Local\LocalFilesystemAdapter; use PhpCollective\Infrastructure\Storage\Factories\LocalFactory; use PhpCollective\Storage\Test\TestCase\StorageTestCase as TestCase; @@ -32,6 +32,6 @@ public function testFactory(): void $adapter = $factory->build([ 'root' => sys_get_temp_dir(), ]); - $this->assertInstanceOf(Local::class, $adapter); + $this->assertInstanceOf(LocalFilesystemAdapter::class, $adapter); } } diff --git a/tests/TestCase/Storage/Factories/MemoryFactoryTest.php b/tests/TestCase/Storage/Factories/MemoryFactoryTest.php index a5dd81d..e0f1c38 100644 --- a/tests/TestCase/Storage/Factories/MemoryFactoryTest.php +++ b/tests/TestCase/Storage/Factories/MemoryFactoryTest.php @@ -14,7 +14,7 @@ namespace PhpCollective\Storage\Test\TestCase\Storage\Factories; -use League\Flysystem\Memory\MemoryAdapter; +use League\Flysystem\InMemory\InMemoryFilesystemAdapter; use PhpCollective\Infrastructure\Storage\Factories\MemoryFactory; use PhpCollective\Storage\Test\TestCase\StorageTestCase as TestCase; @@ -30,6 +30,6 @@ public function testFactory(): void { $factory = new MemoryFactory(); $result = $factory->build([]); - $this->assertInstanceOf(MemoryAdapter::class, $result); + $this->assertInstanceOf(InMemoryFilesystemAdapter::class, $result); } } diff --git a/tests/TestCase/Storage/Factories/NullFactoryTest.php b/tests/TestCase/Storage/Factories/NullFactoryTest.php index 83e23e9..41f678c 100644 --- a/tests/TestCase/Storage/Factories/NullFactoryTest.php +++ b/tests/TestCase/Storage/Factories/NullFactoryTest.php @@ -14,7 +14,7 @@ namespace PhpCollective\Storage\Test\TestCase\Storage\Factories; -use League\Flysystem\Adapter\NullAdapter; +use PhpCollective\Infrastructure\Storage\Adapter\NullFilesystemAdapter; use PhpCollective\Infrastructure\Storage\Factories\NullFactory; use PhpCollective\Storage\Test\TestCase\StorageTestCase as TestCase; @@ -30,6 +30,6 @@ public function testFactory(): void { $factory = new NullFactory(); $adapter = $factory->build([]); - $this->assertInstanceOf(NullAdapter::class, $adapter); + $this->assertInstanceOf(NullFilesystemAdapter::class, $adapter); } } diff --git a/tests/TestCase/Storage/Factories/RackspaceFactoryTest.php b/tests/TestCase/Storage/Factories/RackspaceFactoryTest.php deleted file mode 100644 index d2a3811..0000000 --- a/tests/TestCase/Storage/Factories/RackspaceFactoryTest.php +++ /dev/null @@ -1,53 +0,0 @@ -getMockBuilder(RackspaceFactory::class) - ->setMethods([ - 'buildClient' - ]) - ->getMock(); - - $client = $this->getMockBuilder(Rackspace::class) - ->disableOriginalConstructor() - ->getMock(); - - $factory->expects($this->any()) - ->method('buildClient') - ->willReturn($client); - - $adapter = $factory->build([ - 'serviceRegion' => 'uk', - 'username' => '', - 'apiKey' => '' - ]); - - $this->assertInstanceOf(RackspaceAdapter::class, $adapter); - */ - } -} diff --git a/tests/TestCase/Storage/Factories/ReplicateFactoryTest.php b/tests/TestCase/Storage/Factories/ReplicateFactoryTest.php deleted file mode 100644 index 335695f..0000000 --- a/tests/TestCase/Storage/Factories/ReplicateFactoryTest.php +++ /dev/null @@ -1,66 +0,0 @@ -build([ - 'source' => new NullAdapter(), - 'target' => new NullAdapter(), - ]); - $this->assertInstanceOf(ReplicateAdapter::class, $adapter); - } - - /** - * @return void - */ - public function testMissingConfig(): void - { - $factory = new ReplicateFactory(); - - $this->expectException(FactoryException::class); - $factory->build([ - 'target' => new NullAdapter(), - ]); - } - - /** - * @return void - */ - public function testMissingConfig2(): void - { - $factory = new ReplicateFactory(); - - $this->expectException(FactoryException::class); - $factory->build([ - 'target' => new NullAdapter(), - ]); - } -} diff --git a/tests/TestCase/Storage/Factories/SftpFactoryTest.php b/tests/TestCase/Storage/Factories/SftpFactoryTest.php deleted file mode 100644 index 155012c..0000000 --- a/tests/TestCase/Storage/Factories/SftpFactoryTest.php +++ /dev/null @@ -1,35 +0,0 @@ -build([]); - $this->assertInstanceOf(SftpAdapter::class, $adapter); - } -} diff --git a/tests/TestCase/Storage/Factories/WebDavFactoryTest.php b/tests/TestCase/Storage/Factories/WebDavFactoryTest.php index b843ad1..c5ea93c 100644 --- a/tests/TestCase/Storage/Factories/WebDavFactoryTest.php +++ b/tests/TestCase/Storage/Factories/WebDavFactoryTest.php @@ -15,7 +15,7 @@ namespace PhpCollective\Storage\Test\TestCase\Storage\Factories; use League\Flysystem\WebDAV\WebDAVAdapter; -use PhpCollective\Infrastructure\Storage\Factories\WebDAVFactory; +use PhpCollective\Infrastructure\Storage\Factories\WebDavFactory; use PhpCollective\Storage\Test\TestCase\StorageTestCase as TestCase; /** @@ -28,7 +28,7 @@ class WebDavFactoryTest extends TestCase */ public function testFactory(): void { - $factory = new WebDAVFactory(); + $factory = new WebDavFactory(); $adapter = $factory->build([ 'baseUri' => '/', ]); diff --git a/tests/TestCase/Storage/StorageAdapterFactoryTest.php b/tests/TestCase/Storage/StorageAdapterFactoryTest.php index 15023ee..0e1cb17 100644 --- a/tests/TestCase/Storage/StorageAdapterFactoryTest.php +++ b/tests/TestCase/Storage/StorageAdapterFactoryTest.php @@ -14,7 +14,7 @@ namespace PhpCollective\Storage\Test\TestCase\Storage; -use League\Flysystem\Adapter\Local; +use League\Flysystem\Local\LocalFilesystemAdapter; use PhpCollective\Infrastructure\Storage\Exception\AdapterFactoryNotFoundException; use PhpCollective\Infrastructure\Storage\StorageAdapterFactory; use PhpCollective\Storage\Test\TestCase\StorageTestCase as TestCase; @@ -37,7 +37,7 @@ public function testBuildStorageAdapter(): void 'root' => $this->testPath, ]); - $this->assertInstanceOf(Local::class, $result); + $this->assertInstanceOf(LocalFilesystemAdapter::class, $result); } /**