diff --git a/doc/adapter_async_aws_s3.md b/doc/adapter_async_aws_s3.md index c92cd64..f8c31a7 100644 --- a/doc/adapter_async_aws_s3.md +++ b/doc/adapter_async_aws_s3.md @@ -7,6 +7,9 @@ the S3 client at [async-aws.com](https://async-aws.com/clients/) or use the ```yml services: + acme.async.portable_visibility_converter: + class: League\Flysystem\AsyncAwsS3\PortableVisibilityConverter: + acme.async_s3_client: class: AsyncAws\S3\S3Client arguments: @@ -25,6 +28,8 @@ oneup_flysystem: client: acme.async_s3_client bucket: 'my_image_bucket' prefix: '' + visibilityConverter: acme.async.portable_visibility_converter + ``` ## More to know diff --git a/src/DependencyInjection/Factory/Adapter/AsyncAwsS3Factory.php b/src/DependencyInjection/Factory/Adapter/AsyncAwsS3Factory.php index b40d948..be8ec4d 100644 --- a/src/DependencyInjection/Factory/Adapter/AsyncAwsS3Factory.php +++ b/src/DependencyInjection/Factory/Adapter/AsyncAwsS3Factory.php @@ -19,12 +19,14 @@ public function getKey(): string public function create(ContainerBuilder $container, string $id, array $config): void { + $visibilityConverter = $config['visibilityConverter'] ? new Reference($config['visibilityConverter']) : null; + $container ->setDefinition($id, new ChildDefinition('oneup_flysystem.adapter.async_aws_s3')) ->replaceArgument(0, new Reference($config['client'])) ->replaceArgument(1, $config['bucket']) ->replaceArgument(2, $config['prefix']) - ->replaceArgument(3, $config['visibilityConverter']) + ->replaceArgument(3, $visibilityConverter) ; }