Open
Description
Description
I have the following configuration
framework:
lock:
resources:
shared:
- 'redis://%redis_shared_host%:%redis_shared_port%'
crawler:
- 'redis://%redis_crawler_host%:%redis_crawler_port%'
And I just noticed the naming for the Target attribute:
I have no name! /app/server/backend bin/console debug:autowi lock
Autowirable Types
=================
The following classes & interfaces can be used as type-hints when autowiring:
(only showing classes/interfaces matching lock)
[...]
Factory provides method to create locks.
Symfony\Component\Lock\LockFactory $crawlerLockFactory - target:crawler.lock.factory - alias:lock.crawler.factory
Symfony\Component\Lock\LockFactory $sharedLockFactory - target:shared.lock.factory - alias:lock.shared.factory
So I need to write the following code:
public function __construct(
#[Target('shared.lock.factory')]
private readonly LockFactory $lockFactory,
) {
This is not optimal. I would prefer to write
public function __construct(
#[Target('shared')]
private readonly LockFactory $lockFactory,
) {
I would be more in sync with the http client, and the workflow.
WDYT?
Example
No response