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

[DI] Documented the lint:container command #12785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[DI] Documented the lint:container command
  • Loading branch information
javiereguiluz committed Dec 9, 2019
commit e23ebe00b6c67bdeaadd30a52904429598701c48
22 changes: 22 additions & 0 deletions 22 service_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,28 @@ you don't need to do *anything*: the service will be automatically loaded. Then,
implements ``Twig\Extension\ExtensionInterface``. And thanks to ``autowire``, you can even add
constructor arguments without any configuration.

Linting Service Definitions
---------------------------

.. versionadded:: 4.4

The ``lint:conainer`` command was introduced in Symfony 4.4.

The ``lint:conainer`` command checks that the arguments injected into services
match their type declarations. It's useful to run it before deploying your
application to production (e.g. in your continuous integration server):

.. code-block:: terminal

$ php bin/console lint:container

Checking the types of all service arguments whenever the container is compiled
can hurt performance. That's why this type checking is implemented in a
:doc:`compiler pass </service_container/compiler_passes>` called
``CheckTypeDeclarationsPass`` which is disabled by default and enabled only when
executing the ``lint:container`` command. If you don't mind the performance
loss, enable the compiler pass in your application.

.. _container-public:

Public Versus Private Services
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.