Skip to content

Commit c2727e5

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: (48 commits) docs: choice constraints reference [#7707] minor tweak Fixed code block under "Custom Messages" [#7744] fix XSD locations Minor XML codes fixes [#7686] tweak the example code [#7663] update the PHP example code Update hostname_pattern.rst Add missing ";" Use HTTP instead of http Fixed indentation in security.rst Be consistent on service name Fix missing / Fix trusted hosts example regular expressions fixup comment Testing: Fix typo from #6427 Update apache_router.rst Update fortrabbit.rst Fix some YAML codes Add missing trailing comma & Fix foreach code ...
2 parents 05c632e + 68deeb8 commit c2727e5

File tree

82 files changed

+198
-173
lines changed

Some content is hidden

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

82 files changed

+198
-173
lines changed

assetic/apply_to_option.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,9 @@ In this case you can specify that the ``coffee`` filter is applied to all
163163
name="coffee"
164164
bin="/usr/bin/coffee"
165165
node="/usr/bin/node"
166-
apply_to="\.coffee$" />
167-
<assetic:node-paths>/usr/lib/node_modules/</assetic:node-path>
166+
apply-to="\.coffee$">
167+
<assetic:node-path>/usr/lib/node_modules/</assetic:node-path>
168+
</assetic:filter>
168169
</assetic:config>
169170
</container>
170171
@@ -174,10 +175,10 @@ In this case you can specify that the ``coffee`` filter is applied to all
174175
$container->loadFromExtension('assetic', array(
175176
'filters' => array(
176177
'coffee' => array(
177-
'bin' => '/usr/bin/coffee',
178-
'node' => '/usr/bin/node',
178+
'bin' => '/usr/bin/coffee',
179+
'node' => '/usr/bin/node',
179180
'node_paths' => array('/usr/lib/node_modules/'),
180-
'apply_to' => '\.coffee$',
181+
'apply_to' => '\.coffee$',
181182
),
182183
),
183184
));

assetic/asset_management.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ configuration under the ``assetic`` section. Read more in the
411411
),
412412
),
413413
),
414-
);
414+
));
415415
416416
After you have defined the named assets, you can reference them in your templates
417417
with the ``@named_asset`` notation:

assetic/jpeg_optimize.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ to ``true``:
113113
<assetic:filter
114114
name="jpegoptim"
115115
bin="path/to/jpegoptim"
116-
strip_all="true" />
116+
strip-all="true" />
117117
</assetic:config>
118118
</container>
119119
@@ -217,7 +217,7 @@ following configuration:
217217
name="jpegoptim"
218218
bin="path/to/jpegoptim" />
219219
<assetic:twig>
220-
<assetic:twig_function
220+
<assetic:function
221221
name="jpegoptim" />
222222
</assetic:twig>
223223
</assetic:config>
@@ -234,7 +234,6 @@ following configuration:
234234
),
235235
'twig' => array(
236236
'functions' => array('jpegoptim'),
237-
),
238237
),
239238
));
240239
@@ -277,7 +276,7 @@ file:
277276
name="jpegoptim"
278277
bin="path/to/jpegoptim" />
279278
<assetic:twig>
280-
<assetic:twig_function
279+
<assetic:function
281280
name="jpegoptim"
282281
output="images/*.jpg" />
283282
</assetic:twig>
@@ -296,7 +295,7 @@ file:
296295
'twig' => array(
297296
'functions' => array(
298297
'jpegoptim' => array(
299-
output => 'images/*.jpg'
298+
'output' => 'images/*.jpg',
300299
),
301300
),
302301
),

assetic/php.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ First, configure a new ``scssphp`` Assetic filter:
9999
http://symfony.com/schema/dic/assetic/assetic-1.0.xsd">
100100
101101
<assetic:config>
102-
<filter name="scssphp" formatter="Leafo\ScssPhp\Formatter\Compressed" />
102+
<assetic:filter name="scssphp" formatter="Leafo\ScssPhp\Formatter\Compressed" />
103103
<!-- ... -->
104104
</assetic:config>
105105
</container>
@@ -172,7 +172,7 @@ First, configure a new ``jsqueeze`` Assetic filter as follows:
172172
http://symfony.com/schema/dic/assetic/assetic-1.0.xsd">
173173
174174
<assetic:config>
175-
<filter name="jsqueeze" />
175+
<assetic:filter name="jsqueeze" />
176176
<!-- ... -->
177177
</assetic:config>
178178
</container>

assetic/uglifyjs.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,11 @@ can configure its location using the ``node`` key:
170170
171171
// app/config/config.php
172172
$container->loadFromExtension('assetic', array(
173-
'node' => '/usr/bin/nodejs',
173+
'node' => '/usr/bin/nodejs',
174174
'uglifyjs2' => array(
175-
// the path to the uglifyjs executable
176-
'bin' => '/usr/local/bin/uglifyjs',
177-
),
175+
// the path to the uglifyjs executable
176+
'bin' => '/usr/local/bin/uglifyjs',
177+
),
178178
));
179179
180180
Minify your Assets

best_practices/security.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ To enable the security voter in the application, define a new service:
336336
# app/config/services.yml
337337
services:
338338
# ...
339-
post_voter:
339+
app.post_voter:
340340
class: AppBundle\Security\PostVoter
341341
arguments: ['@security.access.decision_manager']
342342
public: false

bundles/configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ bundle configuration would look like:
8181
8282
<!-- app/config/config.xml -->
8383
<?xml version="1.0" ?>
84-
8584
<container xmlns="http://symfony.com/schema/dic/services"
85+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8686
xmlns:acme-social="http://example.org/schema/dic/acme_social"
8787
xsi:schemaLocation="http://symfony.com/schema/dic/services
8888
http://symfony.com/schema/dic/services/services-1.0.xsd">

bundles/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ of the bundle's configuration:
118118
119119
The output will look like this:
120120

121-
.. code-block:: text
121+
.. code-block:: yaml
122122
123123
assetic:
124124
debug: '%kernel.debug%'

components/console/helpers/progressbar.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ before displaying these messages, you must define your own custom format::
294294
$progressBar->setFormat('custom');
295295

296296
Now, use the ``setMessage()`` method to set the value of the ``%message%``
297-
placeholder before displaying the progress bar:
297+
placeholder before displaying the progress bar::
298298

299299
// ...
300300
$progressBar->setMessage('Start');

components/filesystem.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ endpoint for filesystem operations::
5353
mkdir
5454
~~~~~
5555

56-
:method:`Symfony\\Component\\Filesystem\\Filesystem::mkdir` creates a directory.
56+
:method:`Symfony\\Component\\Filesystem\\Filesystem::mkdir` creates a directory recursively.
5757
On POSIX filesystems, directories are created with a default mode value
5858
`0777`. You can use the second argument to set your own mode::
5959

components/routing.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ to find a route that fits the given request you can also build a URL from
206206
a certain route::
207207

208208
use Symfony\Component\Routing\Generator\UrlGenerator;
209+
use Symfony\Component\Routing\RequestContext;
210+
use Symfony\Component\Routing\Route;
211+
use Symfony\Component\Routing\RouteCollection;
209212

210213
$routes = new RouteCollection();
211214
$routes->add('show_post', new Route('/show/{slug}'));
@@ -321,7 +324,7 @@ a path to the main route definition and some other settings::
321324
$resource,
322325
array $options = array(),
323326
RequestContext $context = null,
324-
array $defaults = array()
327+
LoggerInterface $logger = null
325328
);
326329

327330
With the ``cache_dir`` option you can enable route caching (if you provide a

components/security/authentication.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ The default authentication manager is an instance of
7171
:class:`Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationProviderManager`::
7272

7373
use Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager;
74+
use Symfony\Component\Security\Core\Exception\AuthenticationException;
7475

7576
// instances of Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface
7677
$providers = array(...);
@@ -229,6 +230,7 @@ own, it just needs to follow these rules:
229230
}
230231

231232
// ...
233+
}
232234
}
233235

234236
Using Password Encoders

components/validator/resources.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ method of the Validator builder::
172172

173173
$validator = Validation::createValidatorBuilder()
174174
// ... add loaders
175-
->setMetadataCache(new ApcCache('some_apc_prefix'));
175+
->setMetadataCache(new ApcCache('some_apc_prefix'))
176176
->getValidator();
177177

178178
Using a Custom MetadataFactory
@@ -193,7 +193,7 @@ this custom implementation using
193193
use Symfony\Component\Validator\Validation;
194194

195195
$validator = Validation::createValidatorBuilder()
196-
->setMetadataFactory(new CustomMetadataFactory(...));
196+
->setMetadataFactory(new CustomMetadataFactory(...))
197197
->getValidator();
198198

199199
.. caution::

configuration.rst

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,8 @@ it *also* loads other configuration files via its ``imports`` key:
150150
<?xml version="1.0" encoding="UTF-8" ?>
151151
<container xmlns="http://symfony.com/schema/dic/services"
152152
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
153-
xmlns:framework="http://symfony.com/schema/dic/symfony"
154-
xmlns:twig="http://symfony.com/schema/dic/twig"
155153
xsi:schemaLocation="http://symfony.com/schema/dic/services
156-
http://symfony.com/schema/dic/services/services-1.0.xsd
157-
http://symfony.com/schema/dic/symfony
158-
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd
159-
http://symfony.com/schema/dic/twig
160-
http://symfony.com/schema/dic/twig/twig-1.0.xsd">
154+
http://symfony.com/schema/dic/services/services-1.0.xsd">
161155
162156
<imports>
163157
<import resource="parameters.yml" />
@@ -216,13 +210,10 @@ key:
216210
<container xmlns="http://symfony.com/schema/dic/services"
217211
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
218212
xmlns:framework="http://symfony.com/schema/dic/symfony"
219-
xmlns:twig="http://symfony.com/schema/dic/twig"
220213
xsi:schemaLocation="http://symfony.com/schema/dic/services
221214
http://symfony.com/schema/dic/services/services-1.0.xsd
222215
http://symfony.com/schema/dic/symfony
223-
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd
224-
http://symfony.com/schema/dic/twig
225-
http://symfony.com/schema/dic/twig/twig-1.0.xsd">
216+
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
226217
227218
<!-- ... -->
228219
<parameters>
@@ -316,7 +307,7 @@ configure DoctrineBundle and other parts of Symfony:
316307
.. code-block:: php
317308
318309
// app/config/config.php
319-
$configuration->loadFromExtension('doctrine', array(
310+
$container->loadFromExtension('doctrine', array(
320311
'dbal' => array(
321312
'driver' => 'pdo_mysql',
322313
// ...

configuration/apache_router.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ Symfony to use the ``ApacheUrlMatcher`` instead of the default one:
4444
<!-- app/config/config_prod.xml -->
4545
<parameters>
4646
<parameter key="router.options.matcher.cache_class">null</parameter> <!-- disable router cache -->
47-
<parameter key="router.options.matcher_class">
48-
Symfony\Component\Routing\Matcher\ApacheUrlMatcher
49-
</parameter>
47+
<parameter key="router.options.matcher_class">Symfony\Component\Routing\Matcher\ApacheUrlMatcher</parameter>
5048
</parameters>
5149
5250
.. code-block:: php

configuration/environments.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,10 @@ The best way to accomplish this is via a new environment called, for example,
294294
.. code-block:: php
295295
296296
// app/config/config_benchmark.php
297-
$loader->import('config_prod.php')
297+
$loader->import('config_prod.php');
298298
299299
$container->loadFromExtension('framework', array(
300-
'profiler' => array('only-exceptions' => false),
300+
'profiler' => array('only_exceptions' => false),
301301
));
302302
303303
.. include:: /components/dependency_injection/_imports-parameters-note.rst.inc

console/input.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ To use this, just specify as many names as you want:
7979
8080
You can access the ``names`` argument as an array::
8181

82-
$names = $input->getArgument('names')
82+
$names = $input->getArgument('names');
8383
if (count($names) > 0) {
8484
$text .= ' '.implode(', ', $names);
8585
}

console/request_context.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ will override the defaults.
5454
5555
.. code-block:: php
5656
57-
// app/config/config_test.php
57+
// app/config/parameters.php
5858
$container->setParameter('router.request_context.host', 'example.org');
5959
$container->setParameter('router.request_context.scheme', 'https');
6060
$container->setParameter('router.request_context.base_url', 'my/path');

contributing/documentation/format.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ Whenever a new minor version of Symfony is released (e.g. 2.4, 2.5, etc),
195195
a new branch of the documentation is created from the ``master`` branch.
196196
At this point, all the ``versionadded`` tags for Symfony versions that have
197197
reached end-of-maintenance will be removed. For example, if Symfony 2.5 were
198-
released today, and 2.2 had recently reached its end-of-life, the 2.2 ``versionadded``
199-
tags would be removed from the new ``2.5`` branch.
198+
released today, and 2.2 had recently reached its end-of-maintenance, the 2.2
199+
``versionadded`` tags would be removed from the new ``2.5`` branch.
200200

201201
.. _reStructuredText: http://docutils.sourceforge.net/rst.html
202202
.. _Sphinx: http://sphinx-doc.org/

controller/error_pages.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ configuration option to point to it:
211211
212212
# app/config/config.yml
213213
twig:
214-
exception_controller: AppBundle:Exception:showException
214+
exception_controller: AppBundle:Exception:showException
215215
216216
.. code-block:: xml
217217

controller/service.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ controller:
332332
$templating = $this->templating;
333333
$callback = function () use ($templating, $view, $parameters) {
334334
$templating->stream($view, $parameters);
335-
}
335+
};
336336
337337
return new StreamedResponse($callback);
338338

deployment/fortrabbit.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,16 @@ Make sure this file is imported into the main config file:
122122
.. code-block:: yaml
123123
124124
# app/config/config_prod.yml
125-
imports:
126-
- { resource: config.yml }
127-
- { resource: config_prod_secrets.php }
125+
imports:
126+
- { resource: config.yml }
127+
- { resource: config_prod_secrets.php }
128128
129-
# ..
130-
framework:
131-
session:
132-
# set handler_id to null to use default session handler from php.ini (memcached)
133-
handler_id: ~
134-
# ..
129+
# ..
130+
framework:
131+
session:
132+
# set handler_id to null to use default session handler from php.ini (memcached)
133+
handler_id: ~
134+
# ..
135135
136136
.. code-block:: xml
137137
@@ -151,14 +151,14 @@ Make sure this file is imported into the main config file:
151151
<!-- .. -->
152152
<framework:config>
153153
<!-- .. -->
154-
<framework:session save_path="null" />
154+
<framework:session save-path="null" />
155155
</framework:config>
156156
</container>
157157
158158
.. code-block:: php
159159
160160
// app/config/config_prod.php
161-
$loader->import('config/config.php');
161+
$loader->import('config.php');
162162
$loader->import('config_prod_secrets.php');
163163
164164
$container->loadFromExtension('framework', array(

doctrine.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ information. By convention, this information is usually configured in an
4444
4545
# app/config/parameters.yml
4646
parameters:
47-
database_host: localhost
48-
database_name: test_project
49-
database_user: root
50-
database_password: password
47+
database_host: localhost
48+
database_name: test_project
49+
database_user: root
50+
database_password: password
5151
5252
# ...
5353
@@ -95,7 +95,7 @@ information. By convention, this information is usually configured in an
9595
.. code-block:: php
9696
9797
// app/config/config.php
98-
$configuration->loadFromExtension('doctrine', array(
98+
$container->loadFromExtension('doctrine', array(
9999
'dbal' => array(
100100
'driver' => 'pdo_mysql',
101101
'host' => '%database_host%',

0 commit comments

Comments
 (0)