@@ -306,6 +306,7 @@ For more details, see :doc:`/cookbook/bundles/prepend_extension`, which
306306is specific to the Symfony Framework, but contains more details about this
307307feature.
308308
309+ .. _creating-a-compiler-pass :
309310.. _components-di-compiler-pass :
310311
311312Execute Code During Compilation
@@ -332,8 +333,8 @@ compilation::
332333
333334.. versionadded :: 2.8
334335 Prior to Symfony 2.8, extensions implementing ``CompilerPassInterface ``
335- were not automatically registered. You need to register it as explained in
336- :ref: `the next section <components-di-separate-compiler-passes >`.
336+ were not automatically registered. You needed to register them as explained
337+ in :ref: `the next section <components-di-separate-compiler-passes >`.
337338
338339As ``process() `` is called *after * all extensions are loaded, it allows you to
339340edit service definitions of other extensions as well as retrieving information
@@ -342,12 +343,19 @@ about service definitions.
342343The container's parameters and definitions can be manipulated using the
343344methods described in :doc: `/components/dependency_injection/definitions `.
344345
346+ .. note ::
347+
348+ Please note that the ``process() `` method in the extension class is
349+ called during the optimization step. You can read
350+ :ref: `the next section <components-di-separate-compiler-passes >` if you
351+ need to edit the container during another step.
352+
345353.. note ::
346354
347355 As a rule, only work with services definition in a compiler pass and do not
348- create service instances. Practically , this means using methods `` has() ``,
349- ``findDefinition() ``, ``getDefinition() ``, ``setDefinition() ``, etc.
350- instead of ``get() ``, ``set() ``, etc.
356+ create service instances. In practice , this means using the methods
357+ ``has() ``, `` findDefinition() ``, ``getDefinition() ``, ``setDefinition() ``,
358+ etc. instead of ``get() ``, ``set() ``, etc.
351359
352360.. tip ::
353361
@@ -364,9 +372,10 @@ for an example.
364372Creating Separate Compiler Passes
365373~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
366374
367- Sometimes, you need to do more than one thing during compliation or want to use
368- compiler passes without an extension. In this case, you can create a new class
369- implementing the ``CompilerPassInterface ``::
375+ Sometimes, you need to do more than one thing during compliation, want to use
376+ compiler passes without an extension or you need to execute some code at
377+ another step in the compilation process. In these cases, you can create a new
378+ class implementing the ``CompilerPassInterface ``::
370379
371380 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
372381 use Symfony\Component\DependencyInjection\ContainerBuilder;
0 commit comments