Skip to content

Commit ca08f67

Browse files
committed
feature #12785 [DI] Documented the lint:container command (javiereguiluz)
This PR was merged into the 4.4 branch. Discussion ---------- [DI] Documented the lint:container command Fixes #12589. Commits ------- e23ebe0 [DI] Documented the lint:container command
2 parents 3dd7f1d + e23ebe0 commit ca08f67

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

service_container.rst

+22
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,28 @@ you don't need to do *anything*: the service will be automatically loaded. Then,
788788
implements ``Twig\Extension\ExtensionInterface``. And thanks to ``autowire``, you can even add
789789
constructor arguments without any configuration.
790790

791+
Linting Service Definitions
792+
---------------------------
793+
794+
.. versionadded:: 4.4
795+
796+
The ``lint:conainer`` command was introduced in Symfony 4.4.
797+
798+
The ``lint:conainer`` command checks that the arguments injected into services
799+
match their type declarations. It's useful to run it before deploying your
800+
application to production (e.g. in your continuous integration server):
801+
802+
.. code-block:: terminal
803+
804+
$ php bin/console lint:container
805+
806+
Checking the types of all service arguments whenever the container is compiled
807+
can hurt performance. That's why this type checking is implemented in a
808+
:doc:`compiler pass </service_container/compiler_passes>` called
809+
``CheckTypeDeclarationsPass`` which is disabled by default and enabled only when
810+
executing the ``lint:container`` command. If you don't mind the performance
811+
loss, enable the compiler pass in your application.
812+
791813
.. _container-public:
792814

793815
Public Versus Private Services

0 commit comments

Comments
 (0)