@@ -28,7 +28,7 @@ Getting and Setting Service Definitions
28
28
There are also some helpful methods for
29
29
working with the service definitions.
30
30
31
- To find out if there is a definition for a service id::
31
+ To find out if there is a definition for a service id::
32
32
33
33
$container->hasDefinition($serviceId);
34
34
@@ -84,7 +84,7 @@ To get an array of the constructor arguments for a definition you can use::
84
84
85
85
or to get a single argument by its position::
86
86
87
- $definition->getArgument($index);
87
+ $definition->getArgument($index);
88
88
//e.g. $definition->getArguments(0) for the first argument
89
89
90
90
You can add a new argument to the end of the arguments array using::
@@ -95,7 +95,7 @@ The argument can be a string, an array, a service parameter by using ``%paramete
95
95
or a service id by using ::
96
96
97
97
use Symfony\Component\DependencyInjection\Reference;
98
-
98
+
99
99
// ...
100
100
101
101
$definition->addArgument(new Reference('service_id'));
@@ -131,3 +131,9 @@ You can also replace any existing method calls with an array of new ones with::
131
131
132
132
$definition->setMethodCalls($methodCalls);
133
133
134
+ .. tip ::
135
+
136
+ There are more examples of specific ways of working with definitions
137
+ in the PHP code blocks of the configuration examples on pages such as
138
+ :doc: `/components/dependency_injection/factories ` and
139
+ :doc: `/components/dependency_injection/parentservices `
0 commit comments