File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
DependencyInjection/CompilerPass Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,10 @@ public function process(ContainerBuilder $container): void
3434 $ definition
3535 ->setClass (Filesystem::class)
3636 ->setFactory ([new Reference (FilesystemProvider::class), 'getFilesystem ' ])
37- ->addArgument ($ attributes ['alias ' ]);
37+ ->setArguments ([
38+ $ attributes ['alias ' ],
39+ $ attributes ['config ' ] ?? []
40+ ]);
3841 $ serviceName = sprintf ('api_components.filesystem.%s ' , $ attributes ['alias ' ]);
3942 $ container ->setDefinition ($ serviceName , $ definition );
4043 }
Original file line number Diff line number Diff line change @@ -25,18 +25,14 @@ class FilesystemProvider
2525{
2626 public const FILESYSTEM_ADAPTER_TAG = 'silverback.api_components.filesystem_adapter ' ;
2727
28- private ServiceLocator $ adapters ;
29-
30- public function __construct (ServiceLocator $ adapters )
31- {
32- $ this ->adapters = $ adapters ;
33- }
28+ public function __construct (private readonly ServiceLocator $ adapters )
29+ {}
3430
3531 /**
3632 * @throws RuntimeException
3733 */
38- public function getFilesystem (string $ name ): Filesystem
34+ public function getFilesystem (string $ name, array $ config = [] ): Filesystem
3935 {
40- return new Filesystem ($ this ->adapters ->get ($ name ));
36+ return new Filesystem ($ this ->adapters ->get ($ name ), $ config );
4137 }
4238}
You can’t perform that action at this time.
0 commit comments