Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit177c84a

Browse files
committed
Merge branch '2.8' into 3.4
* 2.8: Add section about anonymous services Add iterable to the Type constraint Added a note about hidden questions, windows and tests
2 parents236acdb +c842209 commit177c84a

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

‎components/console/helpers/questionhelper.rst‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,3 +382,9 @@ This way you can test any user interaction (even complex ones) by passing the ap
382382
The:class:`Symfony\\Component\\Console\\Tester\\CommandTester` automatically
383383
simulates a user hitting ``ENTER`` after each input, no need for passing
384384
an additional input.
385+
386+
..caution::
387+
388+
On Windows systems Symfony uses a special binary to implement hidden
389+
questions. This means that those questions don't use the default ``Input``
390+
console object and therefore you can't test them on Windows.

‎reference/constraints/Type.rst‎

Lines changed: 1 addition & 0 deletions
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‎

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp