Update dependency_injection.rst

Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
This commit is contained in:
Faraz Samapoor
2023-06-16 00:17:49 +03:30
committed by GitHub
parent 55f29c65ab
commit 82df133ca2

View File

@@ -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.