Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e23ebe0

Browse filesBrowse files
committed
[DI] Documented the lint:container command
1 parent f2fcdde commit e23ebe0
Copy full SHA for e23ebe0

File tree

Expand file treeCollapse file tree

1 file changed

+22
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+22
-0
lines changed

‎service_container.rst

Copy file name to clipboardExpand all lines: service_container.rst
+22Lines changed: 22 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.