Skip to content

Commit 16e9fc1

Browse files
guillaume-sainthilliermaxhelias
authored andcommitted
add missing typehints
1 parent 2fc94ea commit 16e9fc1

14 files changed

+30
-29
lines changed

src/Exception/MissingPackageException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
final class MissingPackageException extends \RuntimeException
1818
{
19-
public function __construct($message = '', \Throwable $previous = null)
19+
public function __construct(string $message = '', \Throwable $previous = null)
2020
{
2121
parent::__construct($message, 0, $previous);
2222
}

src/Lazy/LazyFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace League\FlysystemBundle\Lazy;
1313

14+
use League\Flysystem\FilesystemOperator;
1415
use Psr\Container\ContainerInterface;
1516

1617
/**
@@ -27,7 +28,7 @@ public function __construct(ContainerInterface $storages)
2728
$this->storages = $storages;
2829
}
2930

30-
public function createStorage(string $source, string $storageName)
31+
public function createStorage(string $source, string $storageName): FilesystemOperator
3132
{
3233
if ($source === $storageName) {
3334
throw new \InvalidArgumentException('The "lazy" adapter source is referring to itself as "'.$source.'", which would lead to infinite recursion.');

tests/Adapter/AdapterDefinitionFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function provideConfigOptions(): \Generator
3030
/**
3131
* @dataProvider provideConfigOptions
3232
*/
33-
public function testCreateDefinition($name, $options)
33+
public function testCreateDefinition($name, $options): void
3434
{
3535
$factory = new AdapterDefinitionFactory();
3636

tests/Adapter/Builder/AsyncAwsAdapterDefinitionBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function provideValidOptions(): \Generator
4141
/**
4242
* @dataProvider provideValidOptions
4343
*/
44-
public function testCreateDefinition($options)
44+
public function testCreateDefinition($options): void
4545
{
4646
$definition = $this->createBuilder()->createDefinition($options, Visibility::PRIVATE);
4747
$this->assertSame(AsyncAwsS3Adapter::class, $definition->getClass());

tests/Adapter/Builder/AwsAdapterDefinitionBuilderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ public function provideValidOptions(): \Generator
4949
/**
5050
* @dataProvider provideValidOptions
5151
*/
52-
public function testCreateDefinition($options)
52+
public function testCreateDefinition($options): void
5353
{
5454
$this->assertSame(AwsS3V3Adapter::class, $this->createBuilder()->createDefinition($options, null)->getClass());
5555
}
5656

57-
public function testOptionsBehavior()
57+
public function testOptionsBehavior(): void
5858
{
5959
$definition = $this->createBuilder()->createDefinition([
6060
'client' => 'my_client',

tests/Adapter/Builder/AzureAdapterDefinitionBuilderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ public function provideValidOptions(): \Generator
4040
/**
4141
* @dataProvider provideValidOptions
4242
*/
43-
public function testCreateDefinition($options)
43+
public function testCreateDefinition($options): void
4444
{
4545
$this->assertSame(AzureBlobStorageAdapter::class, $this->createBuilder()->createDefinition($options, null)->getClass());
4646
}
4747

48-
public function testOptionsBehavior()
48+
public function testOptionsBehavior(): void
4949
{
5050
$definition = $this->createBuilder()->createDefinition([
5151
'client' => 'my_client',

tests/Adapter/Builder/FtpAdapterDefinitionBuilderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ public function provideValidOptions(): \Generator
4848
/**
4949
* @dataProvider provideValidOptions
5050
*/
51-
public function testCreateDefinition($options)
51+
public function testCreateDefinition($options): void
5252
{
5353
$this->assertSame(FtpAdapter::class, $this->createBuilder()->createDefinition($options, null)->getClass());
5454
}
5555

56-
public function testOptionsBehavior()
56+
public function testOptionsBehavior(): void
5757
{
5858
$definition = $this->createBuilder()->createDefinition([
5959
'host' => 'ftp.example.com',

tests/Adapter/Builder/GcloudAdapterDefinitionBuilderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ public function provideValidOptions(): \Generator
5555
/**
5656
* @dataProvider provideValidOptions
5757
*/
58-
public function testCreateDefinition($options)
58+
public function testCreateDefinition($options): void
5959
{
6060
$this->assertSame(GoogleCloudStorageAdapter::class, $this->createBuilder()->createDefinition($options, null)->getClass());
6161
}
6262

63-
public function testOptionsBehavior()
63+
public function testOptionsBehavior(): void
6464
{
6565
$definition = $this->createBuilder()->createDefinition([
6666
'client' => 'my_client',

tests/Adapter/Builder/GridFSAdapterDefinitionBuilderTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public static function provideValidOptions(): \Generator
6060
/**
6161
* @dataProvider provideValidOptions
6262
*/
63-
public function testCreateDefinition($options)
63+
public function testCreateDefinition($options): void
6464
{
6565
$this->assertSame(GridFSAdapter::class, $this->createBuilder()->createDefinition($options, null)->getClass());
6666
}
@@ -86,7 +86,7 @@ public static function provideInvalidOptions(): \Generator
8686
/**
8787
* @dataProvider provideInvalidOptions
8888
*/
89-
public function testInvalidOptions(array $options, string $message)
89+
public function testInvalidOptions(array $options, string $message): void
9090
{
9191
$builder = $this->createBuilder();
9292

@@ -96,7 +96,7 @@ public function testInvalidOptions(array $options, string $message)
9696
$builder->createDefinition($options, null);
9797
}
9898

99-
public function testInitializeBucketFromDocumentManager()
99+
public function testInitializeBucketFromDocumentManager(): void
100100
{
101101
$client = new Client();
102102
$config = new Configuration();
@@ -112,7 +112,7 @@ public function testInitializeBucketFromDocumentManager()
112112
$this->assertSame('avatars', $bucket->getBucketName());
113113
}
114114

115-
public function testInitializeBucketFromConfig()
115+
public function testInitializeBucketFromConfig(): void
116116
{
117117
$bucket = GridFSAdapterDefinitionBuilder::initializeBucketFromConfig(
118118
'mongodb://server:27017/',

tests/Adapter/Builder/LocalAdapterDefinitionBuilderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ public function provideValidOptions(): \Generator
8888
/**
8989
* @dataProvider provideValidOptions
9090
*/
91-
public function testCreateDefinition($options)
91+
public function testCreateDefinition($options): void
9292
{
9393
$this->assertSame(LocalFilesystemAdapter::class, $this->createBuilder()->createDefinition($options, null)->getClass());
9494
}
9595

96-
public function testOptionsBehavior()
96+
public function testOptionsBehavior(): void
9797
{
9898
$permissions = [
9999
'file' => [

0 commit comments

Comments
 (0)