Skip to content

Commit 242bedd

Browse files
committed
Merge branch '3.4' into 4.0
* 3.4: Add section about anonymous services Add iterable to the Type constraint Added a note about hidden questions, windows and tests
2 parents 4b23bd7 + 177c84a commit 242bedd

File tree

4 files changed

+41
-2
lines changed

4 files changed

+41
-2
lines changed

components/console/helpers/questionhelper.rst

+6
Original file line numberDiff line numberDiff line change
@@ -376,3 +376,9 @@ This way you can test any user interaction (even complex ones) by passing the ap
376376
The :class:`Symfony\\Component\\Console\\Tester\\CommandTester` automatically
377377
simulates a user hitting ``ENTER`` after each input, no need for passing
378378
an additional input.
379+
380+
.. caution::
381+
382+
On Windows systems Symfony uses a special binary to implement hidden
383+
questions. This means that those questions don't use the default ``Input``
384+
console object and therefore you can't test them on Windows.

components/routing.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ routes with UTF-8 characters:
442442
array(
443443
'utf8' => true,
444444
)
445-
);
445+
));
446446
447447
// ...
448448
@@ -521,7 +521,7 @@ You can also include UTF-8 strings as routing requirements:
521521
array(
522522
'utf8' => true,
523523
)
524-
);
524+
));
525525
526526
// ...
527527

reference/constraints/Type.rst

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ datatypes as determined by PHP's ``is_()`` functions.
125125
* :phpfunction:`double <is_double>`
126126
* :phpfunction:`int <is_int>`
127127
* :phpfunction:`integer <is_integer>`
128+
* :phpfunction:`iterable <is_iterable>`
128129
* :phpfunction:`long <is_long>`
129130
* :phpfunction:`null <is_null>`
130131
* :phpfunction:`numeric <is_numeric>`

service_container/alias_private.rst

+32
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,38 @@ This means that when using the container directly, you can access the
146146
# ...
147147
app.mailer: '@App\Mail\PhpMailer'
148148
149+
Anonymous Services
150+
------------------
151+
152+
.. note::
153+
154+
Anonymous services are only supported by the XML configuration format.
155+
156+
In some cases, you may want to prevent a service being used as a dependency of
157+
other services. This can be achieved by creating an anonymous service. These
158+
services are like regular services but they don't define an ID and they are
159+
created where they are used.
160+
161+
The following example shows how to inject an anonymous service into another service:
162+
163+
.. code-block:: xml
164+
165+
<!-- app/config/services.xml -->
166+
<?xml version="1.0" encoding="UTF-8" ?>
167+
<container xmlns="http://symfony.com/schema/dic/services"
168+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
169+
xsi:schemaLocation="http://symfony.com/schema/dic/services
170+
http://symfony.com/schema/dic/services/services-1.0.xsd">
171+
172+
<services>
173+
<service id="foo" class="AppBundle\Foo">
174+
<argument type="service">
175+
<service class="AppBundle\AnonymousBar" />
176+
</argument>
177+
</service>
178+
</services>
179+
</container>
180+
149181
Deprecating Services
150182
--------------------
151183

0 commit comments

Comments
 (0)