-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Symfony version(s) affected: 5.3.6
Description
Currently it's allowed to configure priority on !tagged_locator
but it's ignored while dumping container.
How to reproduce
App\Handler\HandlerLocator:
arguments:
$locator: !tagged_locator
tag: app.handler
index_by: 'id'
default_index_method: 'getId'
default_priority_method: 'getPriority'
class HandlerLocator
{
public function __construct(private ServiceLocator $locator)
{
}
public function get(string $id): HandlerInterface
{
return $this->locator->get($id);
}
public function available(): array
{
return array_keys($this->locator->getProvidedServices());
}
}
// Outputs with wrong order
foreach ($this->locator->available() as $id) {
$output->writeln($id);
}
Additional context
Priority does not make much sense in locator but I have a form type which contains all handlers and I want to output them according to priority