8000 Reword · symfony/symfony-docs@7f314f5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7f314f5

Browse files
committed
Reword
1 parent 45873d6 commit 7f314f5

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

service_container.rst

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -837,15 +837,16 @@ argument for *any* service defined in this file! You can bind arguments by name
837837
The ``bind`` config can also be applied to specific services or when loading many
838838
services at once (i.e. :ref:`service-psr4-loader`).
839839

840-
Abstract service arguments
840+
Abstract Service Arguments
841841
--------------------------
842842

843-
Sometimes, when defining services in your Symfony applications, there are arguments
844-
that can't be added in config files. The reason is that their values can only be
845-
calculated at runtime in a :doc:`compiler pass </service_container/compiler_passes>`
843+
Sometimes, the values of some service arguments can't be defined in the
844+
configuration files because they are calculated at runtime using a
845+
:doc:`compiler pass </service_container/compiler_passes>`
846846
or :doc:`bundle extension </bundles/extension>`.
847847

848-
If value is not replaced a ``RuntimeException`` would be thrown.
848+
In those cases, you can use the ``abstract`` argument type to define at least
849+
the name of the argument and some short description about its purpose:
849850

850851
.. configuration-block::
851852

@@ -899,9 +900,13 @@ If value is not replaced a ``RuntimeException`` would be thrown.
899900
// ...
900901
};
901902
902-
In this case, if you don't replace the value, ``RuntimeException`` will be thrown
903-
with message ``Argument "$rootNamespace" of service "App\Service\MyService" is
904-
abstract: should be defined by Pass.``
903+
If you don't replace the value of an abstract argument during runtime, a
904+
``RuntimeException`` will be thrown with a message like
905+
``Argument "$rootNamespace" of service "App\Service\MyService" is abstract: should be defined by Pass.``
906+
907+
.. versionadded:: 5.1
908+
909+
The abstract service arguments were introduced in Symfony 5.1.
905910

906911
.. _services-autowire:
907912

0 commit comments

Comments
 (0)
0