Skip to content

Commit 4143835

Browse files
Maintained a note about ContainerAwareCommand being deprecated
1 parent f3e8f0e commit 4143835

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

console/commands_as_services.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ works! You can call the ``app:sunshine`` command and start logging.
6060
work (e.g. making database queries), as that code will be run, even if you're using
6161
the console to execute a different command.
6262

63+
.. note::
64+
65+
In previous Symfony versions, you could make the command class extend from
66+
:class:`Symfony\\Bundle\\FrameworkBundle\\Command\\ContainerAwareCommand` to
67+
get services via ``$this->getContainer()->get('SERVICE_ID')``. This is
68+
deprecated in Symfony 4.2 and it won't work in future Symfony versions.
69+
6370
.. _console-command-service-lazy-loading:
6471

6572
Lazy Loading

0 commit comments

Comments
 (0)