Closed pinksnotdead closed 4 years ago
I think I don't understand your requirements. What are you trying to achieve?
I need a service connecting to filesystem, but it have to be more dynamic. StorageConnector must be as service, because i will use this in few places and thats why it need to have ability to dynamically inject custom filesystem
UPDATE it would be simplified to not use Depency Injection in my service: public function __construct(FilesystemInterface $firstFilesystem)
but use inside a method for example: $storage = new Filesystem('storageName') but i dont know which class to use
I still don't get it. You can't dynamically change the services you inject by dependency injection. DI configuration will be precompiled and stored in cache. Here is a list of all types of injection in the service container: https://symfony.com/doc/current/service_container/injection_types.html
I'm closing this, as it is not a problem of this bundle.
Could someone help me with my problem?
https://stackoverflow.com/questions/60019528/oneupflysystembundle-dynamically-change-inject-filesystems-in-symfony