I have one service which is defined in services.yaml with different parameters:
user_uploader:
class: App\Services\UploaderPath
arguments:
$basePath: "%users_directory%"
worker_uploader:
class: App\Services\UploaderPath
arguments:
$basePath: "%workers_directory%"
When I'm injecting that service to another service everything is fine because I can inject it via name.
The problem occurrs when I want to use DI and use for example worker_uploader
public function foo(UploaderPath $workerUploader) {
}
How in this case inject proper service?
$workerUploaderin the class constructor, set it as a class property and then use it like$this->workerUploader->doFoo()@worker_uploader?