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 ca08f67

Browse filesBrowse 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
Copy full SHA for ca08f67

File tree

Expand file treeCollapse file tree

1 file changed

+22
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+22
-0
lines changed
Open diff view settings
Collapse file

‎service_container.rst‎

Copy file name to clipboardExpand all lines: service_container.rst
+22Lines changed: 22 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
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.