From 3df64f7f34258a49df9f34ca3ca00af5f9442644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20Qu=C3=A9tier?= <105283295+LaurentQ56@users.noreply.github.com> Date: Thu, 23 Oct 2025 15:06:38 +0200 Subject: [PATCH] fix(documentation): reorder service id on target attribute When I use the name with suffix `.lock.factory`, the service was not found. After a `debug:container LockFatory`, I see the service ID is `lock.xxx.factory`. `xxx` being the named service wanted. --- lock.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lock.rst b/lock.rst index 03584fbfaa9..f5835bf9a71 100644 --- a/lock.rst +++ b/lock.rst @@ -308,7 +308,7 @@ For example, to inject the ``invoice`` package defined earlier:: When :ref:`dealing with multiple implementations of the same type ` the ``#[Target]`` attribute helps you select which one to inject. Symfony creates -a target called "asset package name" + ``.lock.factory`` suffix. +a target called ``lock.`` + "asset package name" + ``.factory``. For example, to select the ``invoice`` lock defined earlier:: @@ -318,7 +318,7 @@ For example, to select the ``invoice`` lock defined earlier:: class SomeService { public function __construct( - #[Target('invoice.lock.factory')] private LockFactory $lockFactory + #[Target('lock.invoice.factory')] private LockFactory $lockFactory ): void { // ... }