8000 Merge branch '3.3' into 3.4 · symfony/symfony-docs@50d4be6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 50d4be6

Browse files
committed
Merge branch '3.3' into 3.4
* 3.3: (60 commits) Update questionhelper.rst Remove TableHelper Page Documented the new config prototype shortcuts Document the new RequestExceptionInterface Docs re-org and removal of small sections remove deprecated feature description Fix a small typo error (number.rst) Remove deprecated proxy argument Fix instance of class in express language in DI Missing use reference Unused Private param in documentation Doctrine event listener could persist a null value Added about command in debug page Update YAML service Fix "SwitchUserSusbcriber" typo quick tweak to code block type Update flex.rst Updated bootKernel examples to return the $kernel object Minor syntax issue Changing type definition Closure by callable ...
2 parents 8a94262 + 6119ac9 commit 50d4be6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+476
-323
lines changed

_build/redirection_map

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,20 @@
7777
/book/configuration /configuration
7878
/book/propel /propel/propel
7979
/book/performance /performance
80-
/cookbook/assetic/apply_to_option /assetic/apply_to_option
81-
/cookbook/assetic/asset_management /assetic/asset_management
82-
/cookbook/assetic/index /assetic
83-
/cookbook/assetic/jpeg_optimize /assetic/jpeg_optimize
84-
/cookbook/assetic/php /assetic/php
85-
/cookbook/assetic/uglifyjs /assetic/uglifyjs
86-
/cookbook/assetic/yuicompressor /assetic/yuicompressor
80+
/cookbook/assetic/apply_to_option /frontend/assetic/apply_to_option
81+
/cookbook/assetic/asset_management /frontend/assetic/asset_management
82+
/cookbook/assetic/index /frontend/assetic
83+
/cookbook/assetic/jpeg_optimize /frontend/assetic/jpeg_optimize
84+
/cookbook/assetic/php /frontend/assetic/php
85+
/cookbook/assetic/uglifyjs /frontend/assetic/uglifyjs
86+
/cookbook/assetic/yuicompressor /frontend/assetic/yuicompressor
87+
/assetic /frontend/assetic
88+
/assetic/apply_to_option /frontend/assetic/apply_to_option
89+
/assetic/asset_management /frontend/assetic/asset_management
90+
/assetic/jpeg_optimize /frontend/assetic/jpeg_optimize
91+
/assetic/php /frontend/assetic/php
92+
/assetic/uglifyjs /frontend/assetic/uglifyjs
93+
/assetic/yuicompressor /frontend/assetic/yuicompressor
8794
/cookbook/bundles/best_practices /bundles/best_practices
8895
/cookbook/bundles/configuration /bundles/configuration
8996
/cookbook/bundles/extension /bundles/extension
@@ -152,7 +159,8 @@
152159
/cookbook/event_dispatcher/event_listener /event_dispatcher
153160
/cookbook/event_dispatcher/index /event_dispatcher
154161
/cookbook/event_dispatcher/method_behavior /event_dispatcher/method_behavior
155-
/cookbook/expressions /expressions/expressions
162+
/cookbook/expressions /security/expressions
163+
/expressions /security/expressions
156164
/cookbook/form/create_custom_field_type /form/create_custom_field_type
157165
/cookbook/form/create_form_type_extension /form/create_form_type_extension
158166
/cookbook/form/data_transformers /form/data_transformers
@@ -183,10 +191,10 @@
183191
/cookbook/profiler/matchers /profiler/matchers
184192
/cookbook/profiler/profiling_data /profiler/profiling_data
185193
/cookbook/profiler/storage /profiler/storage
186-
/cookbook/psr7 /request/psr7
194+
/cookbook/psr7 /components/psr7
187195
/cookbook/request/index /request
188-
/cookbook/request/load_balancer_reverse_proxy /request/load_balancer_reverse_proxy
189-
/cookbook/request/mime_type /request/mime_type
196+
/cookbook/request/load_balancer_reverse_proxy /deployment/proxies
197+
/cookbook/request/mime_type /reference/configuration/framework#formats
190198
/cookbook/routing/conditions /routing/conditions
191199
/cookbook/routing/custom_route_loader /routing/custom_route_loader
192200
/cookbook/routing/debug /routing/debug
@@ -281,6 +289,7 @@
281289
/components/class_loader/index /components/class_loader
282290
/components/config/introduction /components/config
283291
/components/config/index /components/config
292+
/components/console/helpers/tablehelper /components/console/helpers/table
284293
/components/console/introduction /components/console
285294
/components/console/index /components/console
286295
/components/debug/class_loader /components/debug
@@ -311,7 +320,8 @@
311320
/components/form/type_guesser /form/type_guesser
312321
/components/http_foundation/index /components/http_foundation
313322
/components/http_foundation/introduction /components/http_foundation
314-
/components/http_foundation/trusting_proxies /request/load_balancer_reverse_proxy
323+
/request/load_balancer_reverse_proxy /deployment/proxies
324+
/components/http_foundation/trusting_proxies /deployment/proxies
315325
/components/http_kernel/introduction /components/http_kernel
316326
/components/http_kernel/index /components/http_kernel
317327
/components/property_access/introduction /components/property_access
@@ -341,3 +351,4 @@
341351
/templating/templating_service /templates
342352
/testing/simulating_authentication /testing/http_authentication
343353
/validation/group_service_resolver /form/validation_group_service_resolver
354+
/request/load_balancer_reverse_proxy /deployment/proxies

_images/form/simple-form.png

-5.47 KB
Loading

best_practices/web-assets.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ tools like GruntJS.
5151
Use Assetic to compile, combine and minimize web assets, unless you're
5252
comfortable with frontend tools like GruntJS.
5353

54-
:doc:`Assetic </assetic/asset_management>` is an asset manager capable
54+
:doc:`Assetic </frontend/assetic/asset_management>` is an asset manager capable
5555
of compiling assets developed with a lot of different frontend technologies
5656
like LESS, Sass and CoffeeScript. Combining all your assets with Assetic is a
5757
matter of wrapping all the assets with a single Twig tag:
@@ -89,8 +89,8 @@ Learn More about Assetic
8989
------------------------
9090

9191
Assetic can also minimize CSS and JavaScript assets
92-
:doc:`using UglifyCSS/UglifyJS </assetic/uglifyjs>` to speed up your
93-
websites. You can even :doc:`compress images </assetic/jpeg_optimize>`
92+
:doc:`using UglifyCSS/UglifyJS </frontend/assetic/uglifyjs>` to speed up your
93+
websites. You can even :doc:`compress images </frontend/assetic/jpeg_optimize>`
9494
with Assetic to reduce their size before serving them to the user. Check out
9595
the `official Assetic documentation`_ to learn more about all the available
9696
features.

bundles/extension.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,9 @@ read more about it, see the ":doc:`/bundles/configuration`" article.
129129
Adding Classes to Compile
130130
-------------------------
131131

132-
.. note::
133-
134-
The ``addClassesToCompile()`` method was deprecated in Symfony 3.3, and will
135-
be removed in Symfony 4.0. If you want to use this method and be compatible
136-
with Symfony 4.0, check to see if the method exists before calling it.
132+
.. versionadded:: 3.3
133+
This technique is discouraged and the ``addClassesToCompile()`` method was
134+
deprecated in Symfony 3.3 because modern PHP versions make it unnecessary.
137135

138136
Symfony creates a big ``classes.php`` file in the cache directory to aggregate
139137
the contents of the PHP classes that are used in every request. This reduces the

components/config/definition.rst

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Or you may define a prototype for each node inside an array node::
174174
$rootNode
175175
->children()
176176
->arrayNode('connections')
177-
->prototype('array')
177+
->arrayPrototype()
178178
->children()
179179
->scalarNode('driver')->end()
180180
->scalarNode('host')->end()
@@ -186,6 +186,12 @@ Or you may define a prototype for each node inside an array node::
186186
->end()
187187
;
188188

189+
.. versionadded:: 3.3
190+
The ``arrayPrototype()`` method (and the related ``booleanPrototype()``
191+
``integerPrototype()``, ``floatPrototype()``, ``scalarPrototype()`` and
192+
``enumPrototype()``) was introduced in Symfony 3.3. In previous versions,
193+
you needed to use ``prototype('array')``, ``prototype('boolean')``, etc.
194+
189195
A prototype can be used to add a definition which may be repeated many times
190196
inside the current node. According to the prototype definition in the example
191197
above, it is possible to have multiple connection arrays (containing a ``driver``,
@@ -229,7 +235,7 @@ A basic prototyped array configuration can be defined as follows::
229235
->fixXmlConfig('driver')
230236
->children()
231237
->arrayNode('drivers')
232-
->prototype('scalar')->end()
238+
->scalarPrototype()->end()
233239
->end()
234240
->end()
235241
;
@@ -260,7 +266,7 @@ A more complex example would be to define a prototyped array with children::
260266
->fixXmlConfig('connection')
261267
->children()
262268
->arrayNode('connections')
263-
->prototype('array')
269+
->arrayPrototype()
264270
->children()
265271
->scalarNode('table')->end()
266272
->scalarNode('user')->end()
@@ -334,7 +340,7 @@ In order to maintain the array keys use the ``useAttributeAsKey()`` method::
334340
->children()
335341
->arrayNode('connections')
336342
->useAttributeAsKey('name')
337-
->prototype('array')
343+
->arrayPrototype()
338344
->children()
339345
->scalarNode('table')->end()
340346
->scalarNode('user')->end()
@@ -572,7 +578,7 @@ tree with ``append()``::
572578
->isRequired()
573579
->requiresAtLeastOneElement()
574580
->useAttributeAsKey('name')
575-
->prototype('array')
581+
->arrayPrototype
576582
->children()
577583
->scalarNode('value')->isRequired()->end()
578584
->end()
@@ -670,7 +676,7 @@ with ``fixXmlConfig()``::
670676
->fixXmlConfig('extension')
671677
->children()
672678
->arrayNode('extensions')
673-
->prototype('scalar')->end()
679+
->scalarPrototype()->end()
674680
->end()
675681
->end()
676682
;

components/console/helpers/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ The Console Helpers
1414
progresshelper
1515
questionhelper
1616
table
17-
tablehelper
1817
debug_formatter
1918

2019
The Console component comes with some useful helpers. These helpers contain

components/console/helpers/questionhelper.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ will be autocompleted as the user types::
169169
public function execute(InputInterface $input, OutputInterface $output)
170170
{
171171
// ...
172+
$helper = $this->getHelper('question');
173+
172174
$bundles = array('AcmeDemoBundle', 'AcmeBlogBundle', 'AcmeStoreBundle');
173175
$question = new Question('Please enter the name of a bundle', 'FooBundle');
174176
$question->setAutocompleterValues($bundles);
@@ -188,6 +190,8 @@ convenient for passwords::
188190
public function execute(InputInterface $input, OutputInterface $output)
189191
{
190192
// ...
193+
$helper = $this->getHelper('question');
194+
191195
$question = new Question('What is the database password?');
192196
$question->setHidden(true);
193197
$question->setHiddenFallback(false);
@@ -244,6 +248,8 @@ method::
244248
public function execute(InputInterface $input, OutputInterface $output)
245249
{
246250
// ...
251+
$helper = $this->getHelper('question');
252+
247253
$question = new Question('Please enter the name of the bundle', 'AppBundle');
248254
$question->setNormalizer(function ($value) {
249255
// $value can be null here
@@ -275,6 +281,8 @@ method::
275281
public function execute(InputInterface $input, OutputInterface $output)
276282
{
277283
// ...
284+
$helper = $this->getHelper('question');
285+
278286
$question = new Question('Please enter the name of the bundle', 'AcmeDemoBundle');
279287
$question->setValidator(function ($answer) {
280288
if (!is_string($answer) || 'Bundle' !== substr($answer, -6)) {

components/console/helpers/tablehelper.rst

Lines changed: 0 additions & 12 deletions
This file was deleted.

components/dependency_injection.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
The DependencyInjection Component
66
=================================
77

8-
The DependencyInjection component allows you to standardize and centralize
9-
the way objects are constructed in your application.
8+
The DependencyIn 48DA jection component implements a `PSR-11`_ compatible service
9+
container that allows you to standardize and centralize the way objects are
10+
constructed in your application.
1011

1112
For an introduction to Dependency Injection and service containers see
1213
:doc:`/service_container`.
@@ -305,4 +306,5 @@ Learn More
305306
/components/dependency_injection/*
306307
/service_container/*
307308

309+
.. _`PSR-11`: http://www.php-fig.org/psr/psr-11/
308310
.. _Packagist: https://packagist.org/packages/symfony/dependency-injection

components/expression_language.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ Learn More
125125
:maxdepth: 1
126126
:glob:
127127

128-
/expressions
129128
/components/expression_language/*
130129
/service_container/expression_language
131130
/reference/constraints/Expression

components/filesystem.rst

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,13 @@ exists
7575
~~~~~~
7676

7777
:method:`Symfony\\Component\\Filesystem\\Filesystem::exists` checks for the
78-
presence of all files or directories and returns ``false`` if a file is missing::
78+
presence of one or more files or directories and returns ``false`` if any of
79+
them is missing::
7980

8081
// this directory exists, return true
8182
$fs->exists('/tmp/photos');
8283

83-
// rabbit.jpg exists, bottle.png does not exists, return false
84+
// rabbit.jpg exists, bottle.png does not exist, return false
8485
$fs->exists(array('rabbit.jpg', 'bottle.png'));
8586

8687
.. note::
@@ -91,10 +92,11 @@ presence of all files or directories and returns ``false`` if a file is missing:
9192
copy
9293
~~~~
9394

94-
:method:`Symfony\\Component\\Filesystem\\Filesystem::copy` is used to copy
95-
files. If the target already exists, the file is copied only if the source
96-
modification date is later than the target. This behavior can be overridden by
97-
the third boolean argument::
95+
:method:`Symfony\\Component\\Filesystem\\Filesystem::copy` makes a copy of a
96+
single file (use :method:`Symfony\\Component\\Filesystem\\Filesystem::mirror` to
97+
copy directories). If the target already exists, the file is copied only if the
98+
source modification date is later than the target. This behavior can be overridden
99+
by the third boolean argument::
98100

99101
// works only if image-ICC has been modified after image.jpg
100102
$fs->copy('image-ICC.jpg', 'image.jpg');
@@ -124,8 +126,8 @@ your own with the second argument. The third argument is the access time::
124126
chown
125127
~~~~~
126128

127-
:method:`Symfony\\Component\\Filesystem\\Filesystem::chown` is used to change
128-
the owner of a file. The third argument is a boolean recursive option::
129+
:method:`Symfony\\Component\\Filesystem\\Filesystem::chown` changes the owner of
130+
a file. The third argument is a boolean recursive option::
129131

130132
// set the owner of the lolcat video to www-data
131133
$fs->chown('lolcat.mp4', 'www-data');
@@ -140,8 +142,8 @@ the owner of a file. The third argument is a boolean recursive option::
140142
chgrp
141143
~~~~~
142144

143-
:method:`Symfony\\Component\\Filesystem\\Filesystem::chgrp` is used to change
144-
the group of a file. The third argument is a boolean recursive option::
145+
:method:`Symfony\\Component\\Filesystem\\Filesystem::chgrp` changes the group of
146+
a file. The third argument is a boolean recursive option::
145147

146148
// set the group of the lolcat video to nginx
147149
$fs->chgrp('lolcat.mp4', 'nginx');
@@ -156,8 +158,8 @@ the group of a file. The third argument is a boolean recursive option::
156158
chmod
157159
~~~~~
158160

159-
:method:`Symfony\\Component\\Filesystem\\Filesystem::chmod` is used to change
160-
the mode of a file. The fourth argument is a boolean recursive option::
161+
:method:`Symfony\\Component\\Filesystem\\Filesystem::chmod` changes the mode or
162+
permissions of a file. The fourth argument is a boolean recursive option::
161163

162164
// set the mode of the video to 0600
163165
$fs->chmod('video.ogg', 0600);
@@ -172,8 +174,8 @@ the mode of a file. The fourth argument is a boolean recursive option::
172174
remove
173175
~~~~~~
174176

175-
:method:`Symfony\\Component\\Filesystem\\Filesystem::remove` is used to remove
176-
files, symlinks, directories easily::
177+
:method:`Symfony\\Component\\Filesystem\\Filesystem::remove` deletes files,
178+
directories and symlinks::
177179

178180
$fs->remove(array('symlink', '/path/to/directory', 'activity.log'));
179181

@@ -185,8 +187,8 @@ files, symlinks, directories easily::
185187
rename
186188
~~~~~~
187189

188-
:method:`Symfony\\Component\\Filesystem\\Filesystem::rename` is used to rename
189-
files and directories::
190+
:method:`Symfony\\Component\\Filesystem\\Filesystem::rename` changes the name
191+
of a single file or directory::
190192

191193
// rename a file
192194
$fs->rename('/tmp/processed_video.ogg', '/path/to/store/video_647.ogg');
@@ -243,8 +245,8 @@ Its behavior is the following::
243245
makePathRelative
244246
~~~~~~~~~~~~~~~~
245247

246-
:method:`Symfony\\Component\\Filesystem\\Filesystem::makePathRelative` returns
247-
the relative path of a directory given another one::
248+
:method:`Symfony\\Component\\Filesystem\\Filesystem::makePathRelative` takes two
249+
absolute paths and returns the relative path from the second path to the first one::
248250

249251
// returns '../'
250252
$fs->makePathRelative(
@@ -257,8 +259,10 @@ the relative path of a directory given another one::
257259
mirror
258260
~~~~~~
259261

260-
:method:`Symfony\\Component\\Filesystem\\Filesystem::mirror` mirrors a
261-
directory::
262+
:method:`Symfony\\Component\\Filesystem\\Filesystem::mirror` copies all the
263+
contents of the source directory into the target one (use the
264+
:method:`Symfony\\Component\\Filesystem\\Filesystem::copy` method to copy single
265+
files)::
262266

263267
$fs->mirror('/path/to/source', '/path/to/target');
264268

@@ -280,8 +284,8 @@ isAbsolutePath
280284
dumpFile
281285
~~~~~~~~
282286

283-
:method:`Symfony\\Component\\Filesystem\\Filesystem::dumpFile` allows you to
284-
dump contents to a file. It does this in an atomic manner: it writes a temporary
287+
:method:`Symfony\\Component\\Filesystem\\Filesystem::dumpFile` saves the given
288+
contents into a file. It does this in an atomic manner: it writes a temporary
285289
file first and then moves it to the new file location when it's finished.
286290
This means that the user will always see either the complete old file or
287291
complete new file (but never a partially-written file)::

components/finder.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ the Finder instance.
5555
:phpfunction:`iterator_to_array` method, or get the number of items with
5656
:phpfunction:`iterator_count`.
5757

58+
.. caution::
59+
60+
The ``Finder`` object doesn't reset its internal state automatically.
61+
This means that you need to create a new instance if you do not want
62+
get mixed results.
63+
5864
.. caution::
5965

6066
When searching through multiple locations passed to the

0 commit comments

Comments
 (0)
0