Skip to content

Commit b237ea8

Browse files
committed
Merge branch '2.2' into 2.3
Conflicts: cookbook/form/form_collections.rst
2 parents cf74140 + 32d992a commit b237ea8

27 files changed

+67
-58
lines changed

book/doctrine.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ in a way that makes sense for your needs. The fact that the data needs to
10871087
be persisted to a database is always secondary.
10881088

10891089
Now, look at the metadata above the ``$category`` property on the ``Product``
1090-
class. The information here tells doctrine that the related class is ``Category``
1090+
class. The information here tells Doctrine that the related class is ``Category``
10911091
and that it should store the ``id`` of the category record on a ``category_id``
10921092
field that lives on the ``product`` table. In other words, the related ``Category``
10931093
object will be stored on the ``$category`` property, but behind the scenes,
@@ -1285,7 +1285,7 @@ More Information on Associations
12851285

12861286
This section has been an introduction to one common type of entity relationship,
12871287
the one-to-many relationship. For more advanced details and examples of how
1288-
to use other types of relations (e.g. ``one-to-one``, ``many-to-many``), see
1288+
to use other types of relations (e.g. one-to-one, many-to-many), see
12891289
Doctrine's `Association Mapping Documentation`_.
12901290

12911291
.. note::

book/forms.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,7 @@ Form Fragment Naming
14751475
~~~~~~~~~~~~~~~~~~~~
14761476
14771477
In Symfony, every part of a form that is rendered - HTML form elements, errors,
1478-
labels, etc - is defined in a base theme, which is a collection of blocks
1478+
labels, etc. - is defined in a base theme, which is a collection of blocks
14791479
in Twig and a collection of template files in PHP.
14801480
14811481
In Twig, every block needed is defined in a single template file (`form_div_layout.html.twig`_)

components/console/helpers/dialoghelper.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ in the last argument. Using ``false`` means the amount of attempts is infinite.
141141
The user will be asked as long as he provides an invalid answer and will only
142142
be able to proceed if her input is valid.
143143

144-
Hiding the User's Response
145-
~~~~~~~~~~~~~~~~~~~~~~~~~~
144+
Validating a Hidden Response
145+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
146146

147147
.. versionadded:: 2.2
148148
The ``askHiddenResponseAndValidate`` method was added in Symfony 2.2.

cookbook/configuration/pdo_session_storage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ configuration format of your choice):
1616

1717
.. versionadded:: 2.1
1818
In Symfony 2.1 the class and namespace are slightly modified. You can now
19-
find the session storage classes in the `Session\\Storage` namespace:
19+
find the session storage classes in the ``Session\Storage`` namespace:
2020
``Symfony\Component\HttpFoundation\Session\Storage``. Also
2121
note that in Symfony 2.1 you should configure ``handler_id`` not ``storage_id`` like in Symfony 2.0.
2222
Below, you'll notice that ``%session.storage.options%`` is not used anymore.

cookbook/doctrine/event_listeners_subscribers.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,15 @@ entity), you should check for the entity's class type in your method
157157
Creating the Subscriber Class
158158
-----------------------------
159159

160-
A doctrine event subscriber must implement the ``Doctrine\Common\EventSubscriber``
160+
A Doctrine event subscriber must implement the ``Doctrine\Common\EventSubscriber``
161161
interface and have an event method for each event it subscribes to::
162162

163163
// src/Acme/SearchBundle/EventListener/SearchIndexerSubscriber.php
164164
namespace Acme\SearchBundle\EventListener;
165165

166166
use Doctrine\Common\EventSubscriber;
167167
use Doctrine\ORM\Event\LifecycleEventArgs;
168-
// for doctrine 2.4: Doctrine\Common\Persistence\Event\LifecycleEventArgs;
168+
// for Doctrine 2.4: Doctrine\Common\Persistence\Event\LifecycleEventArgs;
169169
use Acme\StoreBundle\Entity\Product;
170170

171171
class SearchIndexerSubscriber implements EventSubscriber

cookbook/doctrine/file_uploads.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ If you choose to, you can also integrate the file upload into your entity
1313
lifecycle (i.e. creation, update and removal). In this case, as your entity
1414
is created, updated, and removed from Doctrine, the file uploading and removal
1515
processing will take place automatically (without needing to do anything in
16-
your controller);
16+
your controller).
1717

1818
To make this work, you'll need to take care of a number of details, which
1919
will be covered in this cookbook entry.
2020

2121
Basic Setup
2222
-----------
2323

24-
First, create a simple ``Doctrine`` Entity class to work with::
24+
First, create a simple Doctrine entity class to work with::
2525

2626
// src/Acme/DemoBundle/Entity/Document.php
2727
namespace Acme\DemoBundle\Entity;
@@ -427,7 +427,7 @@ call to ``$document->upload()`` should be removed from the controller::
427427
.. caution::
428428

429429
The ``PreUpdate`` and ``PostUpdate`` callbacks are only triggered if there
430-
is a change in one of the entity's field that are persisted. This means
430+
is a change in one of the entity's fields that are persisted. This means
431431
that, by default, if you modify only the ``$file`` property, these events
432432
will not be triggered, as the property itself is not directly persisted
433433
via Doctrine. One solution would be to use an ``updated`` field that's

cookbook/doctrine/multiple_entity_managers.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ You can now use Doctrine just as you did before - using the ``default`` entity
200200
manager to persist and fetch entities that it manages and the ``customer``
201201
entity manager to persist and fetch its entities.
202202

203-
The same applies to repository call::
203+
The same applies to repository calls::
204204

205205
class UserController extends Controller
206206
{
@@ -225,3 +225,4 @@ The same applies to repository call::
225225
;
226226
}
227227
}
228+

cookbook/doctrine/registration_form.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ the class.
9090

9191
.. sidebar:: Why the 4096 Password Limit?
9292

93-
Notice that the ``plainPassword`` has a max length of ``4096`` characters.
93+
Notice that the ``plainPassword`` field has a max length of 4096 characters.
9494
For security purposes (`CVE-2013-5750`_), Symfony limits the plain password
9595
length to 4096 characters when encoding it. Adding this constraint makes
9696
sure that your form will give a validation error if anyone tries a super-long
@@ -139,8 +139,8 @@ Next, create the form for the ``User`` model::
139139
}
140140

141141
There are just two fields: ``email`` and ``plainPassword`` (repeated to confirm
142-
the entered password). The ``data_class`` option tells the form the name of
143-
data class (i.e. your ``User`` entity).
142+
the entered password). The ``data_class`` option tells the form the name of the
143+
underlying data class (i.e. your ``User`` entity).
144144

145145
.. tip::
146146

@@ -224,7 +224,7 @@ Next, create the form for this ``Registration`` model::
224224
}
225225
}
226226

227-
You don't need to use special method for embedding the ``UserType`` form.
227+
You don't need to use a special method for embedding the ``UserType`` form.
228228
A form is a field, too - so you can add this like any other field, with the
229229
expectation that the ``Registration.user`` property will hold an instance
230230
of the ``User`` class.
@@ -260,7 +260,7 @@ controller for displaying the registration form::
260260
}
261261
}
262262

263-
and its template:
263+
And its template:
264264

265265
.. code-block:: html+jinja
266266

@@ -352,6 +352,8 @@ Update your Database Schema
352352
Of course, since you've added a ``User`` entity during this tutorial, make
353353
sure that your database schema has been updated properly:
354354

355+
.. code-block:: bash
356+
355357
$ php app/console doctrine:schema:update --force
356358
357359
That's it! Your form now validates, and allows you to save the ``User``

cookbook/doctrine/reverse_engineering.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ entity in the ``BlogComment`` entity class.
167167

168168
.. note::
169169

170-
If you want to have a ``oneToMany`` relationship, you will need to add
171-
it manually into the entity or to the generated ``xml`` or ``yml`` files.
172-
Add a section on the specific entities for ``oneToMany`` defining the
170+
If you want to have a one-to-many relationship, you will need to add
171+
it manually into the entity or to the generated XML or YAML files.
172+
Add a section on the specific entities for one-to-many defining the
173173
``inversedBy`` and the ``mappedBy`` pieces.
174174

175175
The generated entities are now ready to be used. Have fun!

cookbook/form/dynamic_form_modification.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ it with :ref:`dic-tags-form-type`.
348348
services:
349349
acme.form.friend_message:
350350
class: Acme\DemoBundle\Form\Type\FriendMessageFormType
351-
arguments: [@security.context]
351+
arguments: ["@security.context"]
352352
tags:
353353
-
354354
name: form.type

cookbook/form/form_collections.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ we talk about next!).
555555
}
556556
}
557557

558-
If you have a ``OneToMany`` relationship, then the workaround is similar,
558+
If you have a one-to-many relationship, then the workaround is similar,
559559
except that you can simply call ``setTask`` from inside ``addTag``.
560560

561561
.. _cookbook-form-collections-remove:
@@ -652,11 +652,11 @@ the relationship between the removed ``Tag`` and ``Task`` object.
652652
``Tag`` is properly removed.
653653

654654
In Doctrine, you have two side of the relationship: the owning side and the
655-
inverse side. Normally in this case you'll have a ``ManyToMany`` relation
655+
inverse side. Normally in this case you'll have a many-to-many relation
656656
and the deleted tags will disappear and persist correctly (adding new
657657
tags also works effortlessly).
658658

659-
But if you have an ``OneToMany`` relation or a ``ManyToMany`` with a
659+
But if you have an one-to-many relation or a many-to-many with a
660660
``mappedBy`` on the Task entity (meaning Task is the "inverse" side),
661661
you'll need to do more work for the removed tags to persist correctly.
662662

@@ -703,7 +703,7 @@ the relationship between the removed ``Tag`` and ``Task`` object.
703703
// remove the Task from the Tag
704704
$tag->getTasks()->removeElement($task);
705705

706-
// if it were a ManyToOne relationship, remove the relationship like this
706+
// if it were a many-to-one relationship, remove the relationship like this
707707
// $tag->setTask(null);
708708

709709
$em->persist($tag);
@@ -723,7 +723,7 @@ the relationship between the removed ``Tag`` and ``Task`` object.
723723
}
724724

725725
As you can see, adding and removing the elements correctly can be tricky.
726-
Unless you have a ManyToMany relationship where Task is the "owning" side,
726+
Unless you have a many-to-many relationship where Task is the "owning" side,
727727
you'll need to do extra work to make sure that the relationship is properly
728728
updated (whether you're adding new tags or removing existing tags) on
729729
each Tag object itself.

cookbook/profiler/matchers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Then, you need to configure the service:
101101
services:
102102
acme_demo.profiler.matcher.super_admin:
103103
class: "%acme_demo.profiler.matcher.super_admin.class%"
104-
arguments: [@security.context]
104+
arguments: ["@security.context"]
105105
106106
.. code-block:: xml
107107

cookbook/security/acl_advanced.rst

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ tables are ordered from least rows to most rows in a typical application:
5353

5454
- *acl_security_identities*: This table records all security identities (SID)
5555
which hold ACEs. The default implementation ships with two security
56-
identities: ``RoleSecurityIdentity``, and ``UserSecurityIdentity``
57-
- *acl_classes*: This table maps class names to a unique id which can be
56+
identities:
57+
:class:`Symfony\\Component\\Security\\Acl\\Domain\\RoleSecurityIdentity` and
58+
:class:`Symfony\\Component\\Security\\Acl\\Domain\\UserSecurityIdentity`.
59+
- *acl_classes*: This table maps class names to a unique ID which can be
5860
referenced from other tables.
5961
- *acl_object_identities*: Each row in this table represents a single domain
6062
object instance.
@@ -173,12 +175,13 @@ Process for Reaching Authorization Decisions
173175
The ACL class provides two methods for determining whether a security identity
174176
has the required bitmasks, ``isGranted`` and ``isFieldGranted``. When the ACL
175177
receives an authorization request through one of these methods, it delegates
176-
this request to an implementation of PermissionGrantingStrategy. This allows
177-
you to replace the way access decisions are reached without actually modifying
178-
the ACL class itself.
178+
this request to an implementation of
179+
:class:`Symfony\\Component\\Security\\Acl\\Domain\\PermissionGrantingStrategy`.
180+
This allows you to replace the way access decisions are reached without actually
181+
modifying the ACL class itself.
179182

180-
The PermissionGrantingStrategy first checks all your object-scope ACEs if none
181-
is applicable, the class-scope ACEs will be checked, if none is applicable,
183+
The ``PermissionGrantingStrategy`` first checks all your object-scope ACEs. If none
184+
is applicable, the class-scope ACEs will be checked. If none is applicable,
182185
then the process will be repeated with the ACEs of the parent ACL. If no
183186
parent ACL exists, an exception will be thrown.
184187

cookbook/security/custom_authentication_provider.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ The Factory
281281

282282
You have created a custom token, custom listener, and custom provider. Now
283283
you need to tie them all together. How do you make your provider available
284-
to your security configuration? The answer is by using a ``factory``. A factory
284+
to your security configuration? The answer is by using a *factory*. A factory
285285
is where you hook into the Security component, telling it the name of your
286286
provider and any configuration options available for it. First, you must
287287
create a class which implements
@@ -528,7 +528,7 @@ the ``addConfiguration`` method.
528528
}
529529
530530
Now, in the ``create`` method of the factory, the ``$config`` argument will
531-
contain a 'lifetime' key, set to 5 minutes (300 seconds) unless otherwise
531+
contain a ``lifetime`` key, set to 5 minutes (300 seconds) unless otherwise
532532
set in the configuration. Pass this argument to your authentication provider
533533
in order to put it to use.
534534

cookbook/security/custom_provider.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ users, e.g. by filling in a login form. You can do this by adding a line to the
276276
277277
The value here should correspond with however the passwords were originally
278278
encoded when creating your users (however those users were created). When
279-
a user submits her password, the password is appended to the salt value and
279+
a user submits her password, the salt value is appended to the password and
280280
then encoded using this algorithm before being compared to the hashed password
281281
returned by your ``getPassword()`` method. Additionally, depending on your
282282
options, the password may be encoded multiple times and encoded to base64.

cookbook/security/entity_provider.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ then be checked against your User entity records in the database:
237237
238238
role_hierarchy:
239239
ROLE_ADMIN: ROLE_USER
240-
ROLE_SUPER_ADMIN: [ ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH ]
240+
ROLE_SUPER_ADMIN: [ ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH ]
241241
242242
providers:
243243
administrators:

cookbook/security/target_path.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class and override the default method named ``setTargetPath()``.
1919

2020
First, override the ``security.exception_listener.class`` parameter in your
2121
configuration file. This can be done from your main configuration file (in
22-
`app/config`) or from a configuration file being imported from a bundle:
22+
``app/config``) or from a configuration file being imported from a bundle:
2323

2424
.. configuration-block::
2525

cookbook/security/voters.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Declaring the Voter as a Service
114114
--------------------------------
115115

116116
To inject the voter into the security layer, you must declare it as a service,
117-
and tag it as a "security.voter":
117+
and tag it as a ``security.voter``:
118118

119119
.. configuration-block::
120120

cookbook/session/locale_sticky_session.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ during a user's request. In this article, you'll learn how to make the locale
1010
of a user "sticky" so that once it's set, that same locale will be used for
1111
every subsequent request.
1212

13-
Creating LocaleListener
14-
-----------------------
13+
Creating a LocaleListener
14+
-------------------------
1515

1616
To simulate that the locale is stored in a session, you need to create and
1717
register a :doc:`new event listener </cookbook/service_container/event_listener>`.

cookbook/session/proxy_examples.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ and decrypt the session as required::
3939

4040
public function read($id)
4141
{
42-
$data = parent::write($id, $data);
42+
$data = parent::read($id);
4343

4444
return mcrypt_decrypt(\MCRYPT_3DES, $this->key, $data);
4545
}

cookbook/symfony1.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ places.
6363
In Symfony2, life is much simpler because *all* Symfony2 code must live in
6464
a bundle. In the pretend symfony1 project, all the code *could* be moved
6565
into one or more plugins (which is a very good practice, in fact). Assuming
66-
that all modules, PHP classes, schema, routing configuration, etc were moved
66+
that all modules, PHP classes, schema, routing configuration, etc. were moved
6767
into a plugin, the symfony1 ``plugins/`` directory would be very similar
6868
to the Symfony2 ``src/`` directory.
6969

@@ -176,8 +176,8 @@ from specific directories without defining a dependency:
176176
177177
This means that if a class is not found in the ``vendor`` directory, Composer
178178
will search in the ``src`` directory before throwing a "class does not exist"
179-
exception. Read more about configuring the Composer Autoloader in
180-
`the Composer documentation`_
179+
exception. Read more about configuring the Composer autoloader in
180+
`the Composer documentation`_.
181181

182182
Using the Console
183183
-----------------

cookbook/testing/database.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ your test always has the same data to work with.
1818
Mocking the ``Repository`` in a Unit Test
1919
-----------------------------------------
2020

21-
If you want to test code which depends on a doctrine ``Repository`` in isolation,
21+
If you want to test code which depends on a Doctrine repository in isolation,
2222
you need to mock the ``Repository``. Normally you inject the ``EntityManager``
2323
into your class and use it to get the repository. This makes things a little
2424
more difficult as you need to mock both the ``EntityManager`` and your repository
@@ -27,7 +27,7 @@ class.
2727
.. tip::
2828

2929
It is possible (and a good idea) to inject your repository directly by
30-
registering your repository as a :doc:`factory service </components/dependency_injection/factories>`
30+
registering your repository as a :doc:`factory service </components/dependency_injection/factories>`.
3131
This is a little bit more work to setup, but makes testing easier as you
3232
only need to mock the repository.
3333

cookbook/testing/http_authentication.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ key in your firewall, along with the ``form_login`` key:
3333
security:
3434
firewalls:
3535
your_firewall_name:
36-
http_basic:
36+
http_basic: ~
3737
3838
.. code-block:: xml
3939

cookbook/testing/insulating_clients.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
How to test the Interaction of several Clients
55
==============================================
66

7-
If you need to simulate an interaction between different Clients (think of a
8-
chat for instance), create several Clients::
7+
If you need to simulate an interaction between different clients (think of a
8+
chat for instance), create several clients::
99

1010
$harry = static::createClient();
1111
$sally = static::createClient();

0 commit comments

Comments
 (0)