From 82df133ca2030e6ed54837bde384f9f4f8f22cdc Mon Sep 17 00:00:00 2001 From: Faraz Samapoor Date: Fri, 16 Jun 2023 00:17:49 +0330 Subject: [PATCH] Update dependency_injection.rst Signed-off-by: Faraz Samapoor --- developer_manual/basics/dependency_injection.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/developer_manual/basics/dependency_injection.rst b/developer_manual/basics/dependency_injection.rst index a401f987d..d178ff6fb 100644 --- a/developer_manual/basics/dependency_injection.rst +++ b/developer_manual/basics/dependency_injection.rst @@ -448,8 +448,8 @@ What not to inject: Accessing the container from anywhere ------------------------------------- -Sometimes it can be hard to inject some service inside legacy code, in these case -you can use :code:`OCP\Server::get(MyService::class)`. This should only be used in +Sometimes it can be hard to inject some service inside legacy code, in these cases +you can use :code:`OCP\Server::get(MyService::class)`. This should only be used as the last resort, as this makes your code more complicated to unit test and is considered an anti-pattern.