Skip to content

Commit 84d569d

Browse files
committed
Merge branch '2.3'
2 parents 07341ba + 59fb77e commit 84d569d

File tree

25 files changed

+93
-61
lines changed

25 files changed

+93
-61
lines changed

book/forms.rst

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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/dependency_injection/lazy_services.rst

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,17 @@ the `ProxyManager bridge`_:
3434
3535
.. note::
3636

37-
If you're using the full-stack framework, this package is not included
38-
and needs to be added to ``composer.json`` and installed (which is what
39-
the above command does).
37+
If you're using the full-stack framework, the proxy manager bridge is already
38+
included but the actual proxy manager needs to be included. Therefore add
39+
40+
.. code-block:: json
41+
42+
"require": {
43+
"ocramius/proxy-manager": "0.4.*"
44+
}
45+
46+
to your ``composer.json``. Afterwards compile your container and check
47+
to make sure that you get a proxy for your lazy services.
4048

4149
Configuration
4250
-------------
@@ -71,6 +79,16 @@ the same signature of the class representing the service. You can also inject
7179
the service just like normal into other services. The object that's actually
7280
injected will be the proxy.
7381

82+
To check if your proxy works you can simply check the interface of the
83+
received object.
84+
85+
.. code-block:: php
86+
87+
var_dump(class_implements($service));
88+
89+
If the class implements the "ProxyManager\Proxy\LazyLoadingInterface" your lazy
90+
loaded services are working.
91+
7492
.. note::
7593

7694
If you don't install the `ProxyManager bridge`_, the container will just
@@ -89,4 +107,4 @@ in the `documentation of ProxyManager`_.
89107

90108
.. _`ProxyManager bridge`: https://github.com/symfony/symfony/tree/master/src/Symfony/Bridge/ProxyManager
91109
.. _`proxy`: http://en.wikipedia.org/wiki/Proxy_pattern
92-
.. _`documentation of ProxyManager`: https://github.com/Ocramius/ProxyManager/blob/master/docs/lazy-loading-value-holder.md
110+
.. _`documentation of ProxyManager`: https://github.com/Ocramius/ProxyManager/blob/master/docs/lazy-loading-value-holder.md

components/http_foundation/introduction.rst

Lines changed: 1 addition & 1 deletion
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

Lines changed: 10 additions & 0 deletions
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

Lines changed: 2 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 13 additions & 6 deletions
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

Lines changed: 18 additions & 2 deletions
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

0 commit comments

Comments
 (0)