diff --git a/src/DependencyInjection/Factory/Adapter/GoogleCloudStorageFactory.php b/src/DependencyInjection/Factory/Adapter/GoogleCloudStorageFactory.php index d2ae953..cdd76a6 100644 --- a/src/DependencyInjection/Factory/Adapter/GoogleCloudStorageFactory.php +++ b/src/DependencyInjection/Factory/Adapter/GoogleCloudStorageFactory.php @@ -25,11 +25,13 @@ public function create(ContainerBuilder $container, string $id, array $config): $bucket->setFactory([new Reference($config['client']), 'bucket']); $bucket->setArgument(0, $config['bucket']); + $visibilityHandler = $config['visibilityHandler'] ? new Definition($config['visibilityHandler']) : null; + $container ->setDefinition($id, new ChildDefinition('oneup_flysystem.adapter.googlecloudstorage')) ->replaceArgument(0, $bucket) ->replaceArgument(1, $config['prefix']) - ->replaceArgument(2, $config['visibilityHandler']) + ->replaceArgument(2, $visibilityHandler) ->replaceArgument(3, $config['defaultVisiblity']) ->replaceArgument(4, $config['mimeTypeDetector']) ;