diff --git a/src/Exception/MissingPackageException.php b/src/Exception/MissingPackageException.php index b1ea8bb..c00462d 100644 --- a/src/Exception/MissingPackageException.php +++ b/src/Exception/MissingPackageException.php @@ -16,7 +16,7 @@ */ final class MissingPackageException extends \RuntimeException { - public function __construct($message = '', \Throwable $previous = null) + public function __construct(string $message = '', \Throwable $previous = null) { parent::__construct($message, 0, $previous); } diff --git a/src/Lazy/LazyFactory.php b/src/Lazy/LazyFactory.php index 782bacf..48dfc28 100644 --- a/src/Lazy/LazyFactory.php +++ b/src/Lazy/LazyFactory.php @@ -11,6 +11,7 @@ namespace League\FlysystemBundle\Lazy; +use League\Flysystem\FilesystemOperator; use Psr\Container\ContainerInterface; /** @@ -27,7 +28,7 @@ public function __construct(ContainerInterface $storages) $this->storages = $storages; } - public function createStorage(string $source, string $storageName) + public function createStorage(string $source, string $storageName): FilesystemOperator { if ($source === $storageName) { throw new \InvalidArgumentException('The "lazy" adapter source is referring to itself as "'.$source.'", which would lead to infinite recursion.'); diff --git a/tests/Adapter/AdapterDefinitionFactoryTest.php b/tests/Adapter/AdapterDefinitionFactoryTest.php index dc7d531..fb75ff2 100644 --- a/tests/Adapter/AdapterDefinitionFactoryTest.php +++ b/tests/Adapter/AdapterDefinitionFactoryTest.php @@ -30,7 +30,7 @@ public function provideConfigOptions(): \Generator /** * @dataProvider provideConfigOptions */ - public function testCreateDefinition($name, $options) + public function testCreateDefinition($name, $options): void { $factory = new AdapterDefinitionFactory(); diff --git a/tests/Adapter/Builder/AsyncAwsAdapterDefinitionBuilderTest.php b/tests/Adapter/Builder/AsyncAwsAdapterDefinitionBuilderTest.php index 4eb93fb..e13af2c 100644 --- a/tests/Adapter/Builder/AsyncAwsAdapterDefinitionBuilderTest.php +++ b/tests/Adapter/Builder/AsyncAwsAdapterDefinitionBuilderTest.php @@ -41,7 +41,7 @@ public function provideValidOptions(): \Generator /** * @dataProvider provideValidOptions */ - public function testCreateDefinition($options) + public function testCreateDefinition($options): void { $definition = $this->createBuilder()->createDefinition($options, Visibility::PRIVATE); $this->assertSame(AsyncAwsS3Adapter::class, $definition->getClass()); diff --git a/tests/Adapter/Builder/AwsAdapterDefinitionBuilderTest.php b/tests/Adapter/Builder/AwsAdapterDefinitionBuilderTest.php index a32a091..377414e 100644 --- a/tests/Adapter/Builder/AwsAdapterDefinitionBuilderTest.php +++ b/tests/Adapter/Builder/AwsAdapterDefinitionBuilderTest.php @@ -49,12 +49,12 @@ public function provideValidOptions(): \Generator /** * @dataProvider provideValidOptions */ - public function testCreateDefinition($options) + public function testCreateDefinition($options): void { $this->assertSame(AwsS3V3Adapter::class, $this->createBuilder()->createDefinition($options, null)->getClass()); } - public function testOptionsBehavior() + public function testOptionsBehavior(): void { $definition = $this->createBuilder()->createDefinition([ 'client' => 'my_client', diff --git a/tests/Adapter/Builder/AzureAdapterDefinitionBuilderTest.php b/tests/Adapter/Builder/AzureAdapterDefinitionBuilderTest.php index 3493d6c..13babc4 100644 --- a/tests/Adapter/Builder/AzureAdapterDefinitionBuilderTest.php +++ b/tests/Adapter/Builder/AzureAdapterDefinitionBuilderTest.php @@ -40,12 +40,12 @@ public function provideValidOptions(): \Generator /** * @dataProvider provideValidOptions */ - public function testCreateDefinition($options) + public function testCreateDefinition($options): void { $this->assertSame(AzureBlobStorageAdapter::class, $this->createBuilder()->createDefinition($options, null)->getClass()); } - public function testOptionsBehavior() + public function testOptionsBehavior(): void { $definition = $this->createBuilder()->createDefinition([ 'client' => 'my_client', diff --git a/tests/Adapter/Builder/FtpAdapterDefinitionBuilderTest.php b/tests/Adapter/Builder/FtpAdapterDefinitionBuilderTest.php index 30e60f4..fe72893 100644 --- a/tests/Adapter/Builder/FtpAdapterDefinitionBuilderTest.php +++ b/tests/Adapter/Builder/FtpAdapterDefinitionBuilderTest.php @@ -48,12 +48,12 @@ public function provideValidOptions(): \Generator /** * @dataProvider provideValidOptions */ - public function testCreateDefinition($options) + public function testCreateDefinition($options): void { $this->assertSame(FtpAdapter::class, $this->createBuilder()->createDefinition($options, null)->getClass()); } - public function testOptionsBehavior() + public function testOptionsBehavior(): void { $definition = $this->createBuilder()->createDefinition([ 'host' => 'ftp.example.com', diff --git a/tests/Adapter/Builder/GcloudAdapterDefinitionBuilderTest.php b/tests/Adapter/Builder/GcloudAdapterDefinitionBuilderTest.php index 3d54487..9dc3b42 100644 --- a/tests/Adapter/Builder/GcloudAdapterDefinitionBuilderTest.php +++ b/tests/Adapter/Builder/GcloudAdapterDefinitionBuilderTest.php @@ -55,12 +55,12 @@ public function provideValidOptions(): \Generator /** * @dataProvider provideValidOptions */ - public function testCreateDefinition($options) + public function testCreateDefinition($options): void { $this->assertSame(GoogleCloudStorageAdapter::class, $this->createBuilder()->createDefinition($options, null)->getClass()); } - public function testOptionsBehavior() + public function testOptionsBehavior(): void { $definition = $this->createBuilder()->createDefinition([ 'client' => 'my_client', diff --git a/tests/Adapter/Builder/GridFSAdapterDefinitionBuilderTest.php b/tests/Adapter/Builder/GridFSAdapterDefinitionBuilderTest.php index c7ea289..91c361b 100644 --- a/tests/Adapter/Builder/GridFSAdapterDefinitionBuilderTest.php +++ b/tests/Adapter/Builder/GridFSAdapterDefinitionBuilderTest.php @@ -60,7 +60,7 @@ public static function provideValidOptions(): \Generator /** * @dataProvider provideValidOptions */ - public function testCreateDefinition($options) + public function testCreateDefinition($options): void { $this->assertSame(GridFSAdapter::class, $this->createBuilder()->createDefinition($options, null)->getClass()); } @@ -86,7 +86,7 @@ public static function provideInvalidOptions(): \Generator /** * @dataProvider provideInvalidOptions */ - public function testInvalidOptions(array $options, string $message) + public function testInvalidOptions(array $options, string $message): void { $builder = $this->createBuilder(); @@ -96,7 +96,7 @@ public function testInvalidOptions(array $options, string $message) $builder->createDefinition($options, null); } - public function testInitializeBucketFromDocumentManager() + public function testInitializeBucketFromDocumentManager(): void { $client = new Client(); $config = new Configuration(); @@ -112,7 +112,7 @@ public function testInitializeBucketFromDocumentManager() $this->assertSame('avatars', $bucket->getBucketName()); } - public function testInitializeBucketFromConfig() + public function testInitializeBucketFromConfig(): void { $bucket = GridFSAdapterDefinitionBuilder::initializeBucketFromConfig( 'mongodb://server:27017/', diff --git a/tests/Adapter/Builder/LocalAdapterDefinitionBuilderTest.php b/tests/Adapter/Builder/LocalAdapterDefinitionBuilderTest.php index 1b6998a..2bae698 100644 --- a/tests/Adapter/Builder/LocalAdapterDefinitionBuilderTest.php +++ b/tests/Adapter/Builder/LocalAdapterDefinitionBuilderTest.php @@ -88,12 +88,12 @@ public function provideValidOptions(): \Generator /** * @dataProvider provideValidOptions */ - public function testCreateDefinition($options) + public function testCreateDefinition($options): void { $this->assertSame(LocalFilesystemAdapter::class, $this->createBuilder()->createDefinition($options, null)->getClass()); } - public function testOptionsBehavior() + public function testOptionsBehavior(): void { $permissions = [ 'file' => [ diff --git a/tests/Adapter/Builder/MemoryAdapterDefinitionBuilderTest.php b/tests/Adapter/Builder/MemoryAdapterDefinitionBuilderTest.php index aa24cf9..1ac9633 100644 --- a/tests/Adapter/Builder/MemoryAdapterDefinitionBuilderTest.php +++ b/tests/Adapter/Builder/MemoryAdapterDefinitionBuilderTest.php @@ -22,7 +22,7 @@ public function createBuilder(): MemoryAdapterDefinitionBuilder return new MemoryAdapterDefinitionBuilder(); } - public function testOptionsBehavior() + public function testOptionsBehavior(): void { $this->assertSame(InMemoryFilesystemAdapter::class, $this->createBuilder()->createDefinition([], null)->getClass()); } diff --git a/tests/Adapter/Builder/SftpAdapterDefinitionBuilderTest.php b/tests/Adapter/Builder/SftpAdapterDefinitionBuilderTest.php index c09a735..a1462b5 100644 --- a/tests/Adapter/Builder/SftpAdapterDefinitionBuilderTest.php +++ b/tests/Adapter/Builder/SftpAdapterDefinitionBuilderTest.php @@ -46,12 +46,12 @@ public function provideValidOptions(): \Generator /** * @dataProvider provideValidOptions */ - public function testCreateDefinition($options) + public function testCreateDefinition($options): void { $this->assertSame(SftpAdapter::class, $this->createBuilder()->createDefinition($options, null)->getClass()); } - public function testOptionsBehavior() + public function testOptionsBehavior(): void { $definition = $this->createBuilder()->createDefinition([ 'host' => 'ftp.example.com', diff --git a/tests/DependencyInjection/FlysystemExtensionTest.php b/tests/DependencyInjection/FlysystemExtensionTest.php index 20434ac..814cafb 100644 --- a/tests/DependencyInjection/FlysystemExtensionTest.php +++ b/tests/DependencyInjection/FlysystemExtensionTest.php @@ -24,7 +24,7 @@ class FlysystemExtensionTest extends TestCase { - public function provideFilesystems() + public function provideFilesystems(): \Generator { $fsNames = [ 'fs_aws', @@ -45,7 +45,7 @@ public function provideFilesystems() /** * @dataProvider provideFilesystems */ - public function testFilesystems(string $fsName) + public function testFilesystems(string $fsName): void { $kernel = $this->createFysystemKernel(); $container = $kernel->getContainer()->get('test.service_container'); @@ -58,7 +58,7 @@ public function testFilesystems(string $fsName) /** * @dataProvider provideFilesystems */ - public function testTaggedCollection(string $fsName) + public function testTaggedCollection(string $fsName): void { $kernel = $this->createFysystemKernel(); $container = $kernel->getContainer()->get('test.service_container'); @@ -72,7 +72,7 @@ public function testTaggedCollection(string $fsName) $this->assertInstanceOf(FilesystemOperator::class, $storages[$fsName]); } - public function testPublicUrl() + public function testPublicUrl(): void { $kernel = $this->createFysystemKernel(); $container = $kernel->getContainer()->get('test.service_container'); @@ -82,7 +82,7 @@ public function testPublicUrl() self::assertSame('https://example.org/assets/test1.txt', $fs->publicUrl('test1.txt')); } - public function testPublicUrls() + public function testPublicUrls(): void { $kernel = $this->createFysystemKernel(); $container = $kernel->getContainer()->get('test.service_container'); @@ -94,7 +94,7 @@ public function testPublicUrls() self::assertSame('https://cdn3.example.org/yww/test1.txt', $fs->publicUrl('yww/test1.txt')); } - public function testUrlGenerators() + public function testUrlGenerators(): void { $kernel = $this->createFysystemKernel(); $container = $kernel->getContainer()->get('test.service_container'); @@ -105,7 +105,7 @@ public function testUrlGenerators() self::assertSame('https://example.org/temporary/test1.txt?expiresAt=1670846026', $fs->temporaryUrl('test1.txt', new \DateTimeImmutable('@1670846026'))); } - public function testReadOnly() + public function testReadOnly(): void { $kernel = $this->createFysystemKernel(); $container = $kernel->getContainer()->get('test.service_container'); diff --git a/tests/FlysystemBundleTest.php b/tests/FlysystemBundleTest.php index dadcda5..8b4bd73 100644 --- a/tests/FlysystemBundleTest.php +++ b/tests/FlysystemBundleTest.php @@ -27,7 +27,7 @@ public function provideKernels(): \Generator /** * @dataProvider provideKernels */ - public function testBootKernel(Kernel $kernel) + public function testBootKernel(Kernel $kernel): void { $kernel->boot(); $this->assertArrayHasKey('FlysystemBundle', $kernel->getBundles());