Skip to content

Commit b462510

Browse files
committed
Merge branch '2.8' into 3.1
* 2.8: Remove suggestion to change the parameters Also mention "hassers" A bracket was missed Update birthday.rst Improved Redirecting paragraph of Testing page link to specific HTTP Cache RFC Added jQuery symfony-collection plugin to Form collection docs Update bug documintation input console /console/input.rst Update custom_authentication_provider.rst update github example Update metadata.rst remove caution message
2 parents ec0ddfc + c675825 commit b462510

File tree

11 files changed

+31
-63
lines changed

11 files changed

+31
-63
lines changed

bundles/override.rst

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -37,39 +37,10 @@ If the controller is a service, see the next section on how to override it.
3737
Services & Configuration
3838
------------------------
3939

40-
In order to override/extend a service, there are two options. First, you can
41-
set the parameter holding the service's class name to your own class by setting
42-
it in ``app/config/config.yml``. This of course is only possible if the class name is
43-
defined as a parameter in the service config of the bundle containing the
44-
service. For example, to override the class used for Symfony's ``translator``
45-
service, you would override the ``translator.class`` parameter. Knowing exactly
46-
which parameter to override may take some research. For the translator, the
47-
parameter is defined and used in the ``Resources/config/translation.xml`` file
48-
in the core FrameworkBundle:
49-
50-
.. configuration-block::
51-
52-
.. code-block:: yaml
53-
54-
# app/config/config.yml
55-
parameters:
56-
translator.class: Acme\HelloBundle\Translation\Translator
57-
58-
.. code-block:: xml
59-
60-
<!-- app/config/config.xml -->
61-
<parameters>
62-
<parameter key="translator.class">Acme\HelloBundle\Translation\Translator</parameter>
63-
</parameters>
64-
65-
.. code-block:: php
66-
67-
// app/config/config.php
68-
$container->setParameter('translator.class', 'Acme\HelloBundle\Translation\Translator');
69-
70-
Secondly, if the class is not available as a parameter, you want to make sure the
71-
class is always overridden when your bundle is used or if you need to modify
72-
something beyond just the class name, you should use a compiler pass::
40+
If you want to modify service definitions of another bundle, you can use a compiler
41+
pass to change the class of the service or to modify method calls. In the following
42+
example, the implementing class for the ``original-service-id`` is changed to
43+
``Acme\DemoBundle\YourService``::
7344

7445
// src/Acme/DemoBundle/DependencyInjection/Compiler/OverrideServiceCompilerPass.php
7546
namespace Acme\DemoBundle\DependencyInjection\Compiler;
@@ -86,12 +57,7 @@ something beyond just the class name, you should use a compiler pass::
8657
}
8758
}
8859

89-
In this example you fetch the service definition of the original service, and set
90-
its class name to your own class.
91-
92-
See :doc:`/service_container/compiler_passes` for information on how to use
93-
compiler passes. If you want to do something beyond just overriding the class,
94-
like adding a method call, you can only use the compiler pass method.
60+
For more information on compiler passes, see :doc:`/service_container/compiler_passes`.
9561

9662
Entities & Entity Mapping
9763
-------------------------

components/dom_crawler.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ directly::
440440
$crawler = $client->request('GET', 'https://github.com/login');
441441

442442
// select the form and fill in some values
443-
$form = $crawler->selectButton('Log in')->form();
443+
$form = $crawler->selectButton('Sign in')->form();
444444
$form['login'] = 'symfonyfan';
445445
$form['password'] = 'anypass';
446446

components/validator/metadata.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ Getters
3636
-------
3737

3838
Constraints can also be applied to the value returned by any public *getter*
39-
method, which are the methods whose names start with ``get`` or ``is``. This
40-
feature allows to validate your objects dynamically.
39+
method, which are the methods whose names start with ``get``, ``has`` or ``is``.
40+
This feature allows to validate your objects dynamically.
4141

4242
Suppose that, for security reasons, you want to validate that a password field
4343
doesn't match the first name of the user. First, create a public method called
@@ -58,7 +58,7 @@ Then, add the Validator component configuration to the class::
5858
{
5959
public static function loadValidatorMetadata(ClassMetadata $metadata)
6060
{
61-
$metadata->addGetterConstraint('passwordSafe', new Assert\True(array(
61+
$metadata->addGetterConstraint('passwordSafe', new Assert\IsTrue(array(
6262
'message' => 'The password cannot match your first name',
6363
)));
6464
}

console/input.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ You now have access to a ``last_name`` argument in your command::
4141
{
4242
$text = 'Hi '.$input->getArgument('name');
4343

44-
$lastName = $input->getArgument('last_name')
44+
$lastName = $input->getArgument('last_name');
4545
if ($lastName) {
4646
$text .= ' '.$lastName;
4747
}

form/form_collections.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,5 +732,13 @@ the relationship between the removed ``Tag`` and ``Task`` object.
732732
updated (whether you're adding new tags or removing existing tags) on
733733
each Tag object itself.
734734

735+
.. sidebar:: Form collection jQuery plugin
736+
737+
The jQuery plugin `symfony-collection`_ helps with ``collection`` form elements,
738+
by providing the JavaScript functionality needed to add, edit and delete
739+
elements of the collection. More advanced functionality like moving or duplicating
740+
an element in the collection and customizing the buttons is also possible.
741+
735742
.. _`Owning Side and Inverse Side`: http://docs.doctrine-project.org/en/latest/reference/unitofwork-associations.html
736743
.. _`JSFiddle`: http://jsfiddle.net/847Kf/4/
744+
.. _`symfony-collection`: https://github.com/ninsuo/symfony-collection

http_cache.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ isn't always possible for highly dynamic sites, or is it? With
1919
on only *fragments* of your site.
2020

2121
The Symfony cache system is different because it relies on the simplicity
22-
and power of the HTTP cache as defined in the `HTTP specification`_. Instead of
22+
and power of the HTTP cache as defined in `RFC 7234 - Caching`_. Instead of
2323
reinventing a caching methodology, Symfony embraces the standard that defines
2424
basic communication on the Web. Once you understand the fundamental HTTP
2525
validation and expiration caching models, you'll be ready to master the Symfony
@@ -367,4 +367,3 @@ Learn more
367367
.. _`RFC 7234 - Caching`: https://tools.ietf.org/html/rfc7234
368368
.. _`RFC 7232 - Conditional Requests`: https://tools.ietf.org/html/rfc7232
369369
.. _`FOSHttpCacheBundle`: http://foshttpcachebundle.readthedocs.org/
370-
.. _`HTTP specification`: http://www.w3.org/Protocols/rfc2616/rfc2616.html

reference/forms/types/birthday.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ If your widget option is set to ``choice``, then this field will be represented
7777
as a series of ``select`` boxes. When the placeholder value is a string,
7878
it will be used as the **blank value** of all select boxes::
7979

80-
$builder->add('birthdate', 'birthday', array(
80+
$builder->add('birthdate', BirthdayType::class, array(
8181
'placeholder' => 'Select a value',
8282
));
8383

8484
Alternatively, you can use an array that configures different placeholder
8585
values for the year, month and day fields::
8686

87-
$builder->add('birthdate', 'birthday', array(
87+
$builder->add('birthdate', BirthdayType::class, array(
8888
'placeholder' => array(
8989
'year' => 'Year', 'month' => 'Month', 'day' => 'Day',
9090
)

reference/forms/types/choice.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,18 @@ You can easily "group" options in a select by passing a multi-dimensional choice
132132
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
133133
// ...
134134

135-
$builder->add('stockStatus', ChoiceType::class, [
136-
'choices' => [
137-
'Main Statuses' => [
135+
$builder->add('stockStatus', ChoiceType::class, array(
136+
'choices' => array(
137+
'Main Statuses' => array(
138138
'Yes' => 'stock_yes',
139139
'No' => 'stock_no',
140-
],
141-
'Out of Stock Statuses' => [
140+
),
141+
'Out of Stock Statuses' => array(
142142
'Backordered' => 'stock_backordered',
143143
'Discontinued' => 'stock_discontinued',
144-
]
145-
],
146-
);
144+
),
145+
),
146+
));
147147

148148
.. image:: /_images/reference/form/choice-example4.png
149149
:align: center

security/custom_authentication_provider.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ How to Create a custom Authentication Provider
88

99
Creating a custom authentication system is hard, and this entry will walk
1010
you through that process. But depending on your needs, you may be able
11-
to solve your problem in a simpler, or via a community bundle:
11+
to solve your problem in a simpler manner, or via a community bundle:
1212

1313
* :doc:`/security/guard_authentication`
1414
* :doc:`/security/custom_password_authenticator`

service_container/alias_private.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,3 @@ occurrence of the ``%service_id%`` placeholder in your template.
191191
For service decorators (see above), if the definition does not modify the
192192
deprecated status, it will inherit the status from the definition that is
193193
decorated.
194-
195-
.. caution::
196-
197-
The ability to "un-deprecate" a service is possible only when declaring the
198-
definition in PHP.

testing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ afterwards with the ``followRedirect()`` method::
495495
$crawler = $client->followRedirect();
496496

497497
If you want the client to automatically follow all redirects, you can
498-
force him with the ``followRedirects()`` method::
498+
force them by calling the ``followRedirects()`` method before performing the request::
499499

500500
$client->followRedirects();
501501

0 commit comments

Comments
 (0)