Skip to content

Commit

Permalink
AsyncAWS - visibilityConverter should be a service (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrantosik authored Oct 15, 2024
1 parent c1c3172 commit 23d7186
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions doc/adapter_async_aws_s3.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;
}

Expand Down

0 comments on commit 23d7186

Please sign in to comment.