Skip to content

Commit 59fb77e

Browse files
committed
Merge branch '2.2' into 2.3
2 parents ad7c1dc + e6ccb44 commit 59fb77e

File tree

16 files changed

+58
-27
lines changed

16 files changed

+58
-27
lines changed

book/forms.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ object.
368368
<constraint name="Type">\DateTime</constraint>
369369
</property>
370370
</class>
371-
<constraint-mapping>
371+
</constraint-mapping>
372372
373373
.. code-block:: php
374374

book/validation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ and then the groups in the group sequence are validated in order.
812812
.. tip::
813813

814814
Group sequences cannot contain the group ``Default``, as this would create
815-
a loop. Instead, use the group ``{ClassName}`` (e.g. ``User``) instead.
815+
a loop. Instead, use the group ``{ClassName}`` (e.g. ``User``).
816816

817817
For example, suppose you have a ``User`` class and want to validate that the
818818
username and the password are different only if all other validation passes

components/dependency_injection/definitions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ To get an array of the constructor arguments for a definition you can use::
6666
or to get a single argument by its position::
6767

6868
$definition->getArgument($index);
69-
//e.g. $definition->getArguments(0) for the first argument
69+
//e.g. $definition->getArgument(0) for the first argument
7070

7171
You can add a new argument to the end of the arguments array using::
7272

components/http_foundation/introduction.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ If you need to get full access to parsed data from ``Accept``, ``Accept-Language
251251

252252
$accept = AcceptHeader::fromString($request->headers->get('Accept'));
253253
if ($accept->has('text/html')) {
254-
$item = $accept->get('html');
254+
$item = $accept->get('text/html');
255255
$charset = $item->getAttribute('charset', 'utf-8');
256256
$quality = $item->getQuality();
257257
}

contributing/code/standards.rst

+10
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,16 @@ Naming Conventions
134134
* Don't forget to look at the more verbose :doc:`conventions` document for
135135
more subjective naming considerations.
136136

137+
Service Naming Conventions
138+
~~~~~~~~~~~~~~~~~~~~~~~~~~
139+
140+
* A service name contains groups, separated by dots;
141+
* The DI alias of the bundle is the first group (e.g. ``fos_user``);
142+
* Use lowercase letters for service and parameter names;
143+
* A group name uses the underscore notation;
144+
* Each service has a corresponding parameter containing the class name,
145+
following the ``SERVICE NAME.class`` convention.
146+
137147
Documentation
138148
-------------
139149

contributing/documentation/overview.rst

+2-4
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,9 @@ Creating a Pull Request
5757
Following the example, the pull request will default to be between your
5858
``improving_foo_and_bar`` branch and the ``symfony-docs`` ``master`` branch.
5959

60-
.. image:: /images/docs-pull-request.png
61-
:align: center
62-
6360
If you have made your changes based on the 2.2 branch then you need to change
64-
the base branch to be 2.2 on the preview page:
61+
the base branch to be 2.2 on the preview page by clicking the ``edit`` button
62+
on the top left:
6563

6664
.. image:: /images/docs-pull-request-change-base.png
6765
:align: center

contributing/documentation/translations.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ for. Here is the list of the official *master* repositories:
2020
* *French*: https://github.com/symfony-fr/symfony-docs-fr
2121
* *Italian*: https://github.com/garak/symfony-docs-it
2222
* *Japanese*: https://github.com/symfony-japan/symfony-docs-ja
23-
* *Polish*: https://github.com/ampluso/symfony-docs-pl
23+
* *Polish*: https://github.com/symfony-docs-pl/symfony-docs-pl
2424
* *Portuguese (Brazilian)*: https://github.com/andreia/symfony-docs-pt-BR
2525
* *Spanish*: https://github.com/gitnacho/symfony-docs-es
2626

cookbook/assetic/apply_to_option.rst

+13-6
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ as you'll see here, files that have a specific extension. To show you how
99
to handle each option, let's suppose that you want to use Assetic's CoffeeScript
1010
filter, which compiles CoffeeScript files into Javascript.
1111

12-
The main configuration is just the paths to coffee and node. These default
13-
respectively to ``/usr/bin/coffee`` and ``/usr/bin/node``:
12+
The main configuration is just the paths to coffee, node and node_modules.
13+
An example configuration might look like this:
1414

1515
.. configuration-block::
1616

@@ -22,15 +22,18 @@ respectively to ``/usr/bin/coffee`` and ``/usr/bin/node``:
2222
coffee:
2323
bin: /usr/bin/coffee
2424
node: /usr/bin/node
25+
node_paths: [ /usr/lib/node_modules/ ]
2526
2627
.. code-block:: xml
2728
2829
<!-- app/config/config.xml -->
2930
<assetic:config>
30-
<assetic:filter
31+
<assetic:filter
3132
name="coffee"
32-
bin="/usr/bin/coffee"
33-
node="/usr/bin/node" />
33+
bin="/usr/bin/coffee/"
34+
node="/usr/bin/node/">
35+
<assetic:node-paths>/usr/lib/node_modules/</assetic:node-path>
36+
</assetic:filter>
3437
</assetic:config>
3538
3639
.. code-block:: php
@@ -41,6 +44,7 @@ respectively to ``/usr/bin/coffee`` and ``/usr/bin/node``:
4144
'coffee' => array(
4245
'bin' => '/usr/bin/coffee',
4346
'node' => '/usr/bin/node',
47+
'node_paths' => array('/usr/lib/node_modules/'),
4448
),
4549
),
4650
));
@@ -128,6 +132,7 @@ applied to all ``.coffee`` files:
128132
coffee:
129133
bin: /usr/bin/coffee
130134
node: /usr/bin/node
135+
node_paths: [ /usr/lib/node_modules/ ]
131136
apply_to: "\.coffee$"
132137
133138
.. code-block:: xml
@@ -139,8 +144,9 @@ applied to all ``.coffee`` files:
139144
bin="/usr/bin/coffee"
140145
node="/usr/bin/node"
141146
apply_to="\.coffee$" />
147+
<assetic:node-paths>/usr/lib/node_modules/</assetic:node-path>
142148
</assetic:config>
143-
149+
144150
.. code-block:: php
145151
146152
// app/config/config.php
@@ -149,6 +155,7 @@ applied to all ``.coffee`` files:
149155
'coffee' => array(
150156
'bin' => '/usr/bin/coffee',
151157
'node' => '/usr/bin/node',
158+
'node_paths' => array('/usr/lib/node_modules/'),
152159
'apply_to' => '\.coffee$',
153160
),
154161
),

cookbook/console/console_command.rst

+18-2
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,25 @@ instead of
104104

105105
$command = $application->find('demo:greet');
106106
$commandTester = new CommandTester($command);
107-
$commandTester->execute(array('command' => $command->getName()));
107+
$commandTester->execute(
108+
array(
109+
'name' => 'Fabien',
110+
'--yell' => true,
111+
)
112+
);
108113

109114
$this->assertRegExp('/.../', $commandTester->getDisplay());
110115

111116
// ...
112117
}
113118
}
114119

120+
.. note::
121+
122+
In the specific case above, the ``name`` parameter and the ``--yell`` option
123+
are not mandatory for the command to work, but are shown so you can see
124+
how to customize them when calling the command.
125+
115126
To be able to use the fully set up service container for your console tests
116127
you can extend your test from
117128
:class:`Symfony\\Bundle\\FrameworkBundle\\Test\\WebTestCase`::
@@ -133,7 +144,12 @@ you can extend your test from
133144

134145
$command = $application->find('demo:greet');
135146
$commandTester = new CommandTester($command);
136-
$commandTester->execute(array('command' => $command->getName()));
147+
$commandTester->execute(
148+
array(
149+
'name' => 'Fabien',
150+
'--yell' => true,
151+
)
152+
);
137153

138154
$this->assertRegExp('/.../', $commandTester->getDisplay());
139155

cookbook/controller/service.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,12 @@ inject *only* the exact service(s) that you need directly into the controller.
257257

258258
This does not mean that you cannot extend these controllers from your own
259259
base controller. The move away from the standard base controller is because
260-
its helper method rely on having the container available which is not
260+
its helper methods rely on having the container available which is not
261261
the case for controllers that are defined as services. It may be a good
262262
idea to extract common code into a service that's injected rather than
263263
place that code into a base controller that you extend. Both approaches
264264
are valid, exactly how you want to organize your reusable code is up to
265265
you.
266266

267267
.. _`Controller class source code`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
268-
.. _`base Controller class`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
268+
.. _`base Controller class`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php

cookbook/form/dynamic_form_modification.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ sport like this::
419419

420420
$builder->addEventListener(
421421
FormEvents::PRE_SET_DATA,
422-
function(FormEvent $event) use($user, $factory){
422+
function(FormEvent $event) use($factory){
423423
$form = $event->getForm();
424424

425425
// this would be your entity, i.e. SportMeetup

cookbook/security/voters.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ which requires the following three methods:
2525
2626
interface VoterInterface
2727
{
28-
function supportsAttribute($attribute);
29-
function supportsClass($class);
30-
function vote(TokenInterface $token, $object, array $attributes);
28+
public function supportsAttribute($attribute);
29+
public function supportsClass($class);
30+
public function vote(TokenInterface $token, $object, array $attributes);
3131
}
3232
3333
The ``supportsAttribute()`` method is used to check if the voter supports
@@ -85,7 +85,7 @@ and compare the IP address against a set of blacklisted IP addresses:
8585
return true;
8686
}
8787
88-
function vote(TokenInterface $token, $object, array $attributes)
88+
public function vote(TokenInterface $token, $object, array $attributes)
8989
{
9090
$request = $this->container->get('request');
9191
if (in_array($request->getClientIp(), $this->blacklistedIp)) {
2.45 KB
Loading

images/docs-pull-request.png

-27.9 KB
Binary file not shown.

reference/constraints/All.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ entry in that array:
4444
{
4545
/**
4646
* @Assert\All({
47-
* @Assert\NotBlank
48-
* @Assert\Length(min = "5"),
47+
* @Assert\NotBlank,
48+
* @Assert\Length(min = "5")
4949
* })
5050
*/
5151
protected $favoriteColors = array();

reference/constraints/UniqueEntity.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ table:
9999
'message' => 'This email already exists.',
100100
)));
101101
102-
$metadata->addPropertyConstraint(new Assert\Email());
102+
$metadata->addPropertyConstraint('email', new Assert\Email());
103103
}
104104
}
105105

0 commit comments

Comments
 (0)