Skip to content

Commit 2409a3a

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: Update events.rst First parameter to uniqid must be a string fix #8321 minor changes in Serializer Component Update filesystem.rst Update create_custom_field_type.rst Use "impersonator user" instead of "impersonating user" Update dynamic_form_modification.rst Update data_transformers.rst
2 parents c4d3e5d + f663f52 commit 2409a3a

8 files changed

+22
-13
lines changed

components/filesystem.rst

+8
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ On POSIX filesystems, directories are created with a default mode value
6868

6969
This function ignores already existing directories.
7070

71+
.. note::
72+
73+
The directory permissions are affected by the current `umask`_.
74+
Set the umask for your webserver, use PHP's :phpfunction:`umask`
75+
function or use the :phpfunction:`chmod` function after the
76+
directory has been created.
77+
7178
exists
7279
~~~~~~
7380

@@ -278,3 +285,4 @@ Learn More
278285
filesystem/*
279286

280287
.. _`Packagist`: https://packagist.org/packages/symfony/filesystem
288+
.. _`umask`: https://en.wikipedia.org/wiki/Umask

components/serializer.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,9 @@ and :class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer`::
410410
$obj->name = 'Acme Inc.';
411411
$obj->address = '123 Main Street, Big City';
412412

413-
$json = $serializer->serialize($obj);
413+
$json = $serializer->serialize($obj, 'json');
414414
// {"org_name": "Acme Inc.", "org_address": "123 Main Street, Big City"}
415-
$objCopy = $serializer->deserialize($json);
415+
$objCopy = $serializer->deserialize($json, Company::class, 'json');
416416
// Same data as $obj
417417

418418
.. _using-camelized-method-names-for-underscored-attributes:

form/create_custom_field_type.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ registered as a service. Because you used the ``form.type`` tag in its configura
412412
your service will be used instead of creating a *new* ``ShippingType``. In other words,
413413
your controller *does not need to change*, it still looks like this::
414414

415-
// src/AppBundle/Form/Type/AuthorType.php
415+
// src/AppBundle/Form/Type/OrderType.php
416416
namespace AppBundle\Form\Type;
417417

418418
use Symfony\Component\Form\AbstractType;

form/data_transformers.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Simple Example: Transforming String Tags from User Input to an Array
2323

2424
Suppose you have a Task form with a tags ``text`` type::
2525

26-
// src/AppBundle/Form/TaskType.php
26+
// src/AppBundle/Form/Type/TaskType.php
2727
namespace AppBundle\Form\Type;
2828

2929
use AppBundle\Entity\Task;
@@ -56,7 +56,7 @@ This is a *perfect* time to attach a custom data transformer to the ``tags``
5656
field. The easiest way to do this is with the :class:`Symfony\\Component\\Form\\CallbackTransformer`
5757
class::
5858

59-
// src/AppBundle/Form/TaskType.php
59+
// src/AppBundle/Form/Type/TaskType.php
6060
namespace AppBundle\Form\Type;
6161

6262
use Symfony\Component\Form\CallbackTransformer;
@@ -120,7 +120,7 @@ issue number.
120120

121121
Start by setting up the text field like normal::
122122

123-
// src/AppBundle/Form/TaskType.php
123+
// src/AppBundle/Form/Type/TaskType.php
124124
namespace AppBundle\Form\Type;
125125

126126
use AppBundle\Entity\Task;
@@ -253,7 +253,7 @@ of the entity manager (because ``IssueToNumberTransformer`` needs this).
253253
No problem! Just add a ``__construct()`` function to ``TaskType`` and force this
254254
to be passed in by registering ``TaskType`` as a service::
255255

256-
// src/AppBundle/Form/TaskType.php
256+
// src/AppBundle/Form/Type/TaskType.php
257257
namespace AppBundle\Form\Type;
258258

259259
use AppBundle\Form\DataTransformer\IssueToNumberTransformer;
@@ -465,7 +465,7 @@ it's recognized as a custom field type:
465465
Now, whenever you need to use your special ``issue_selector`` field type,
466466
it's quite easy::
467467

468-
// src/AppBundle/Form/TaskType.php
468+
// src/AppBundle/Form/Type/TaskType.php
469469
namespace AppBundle\Form\Type;
470470

471471
use AppBundle\Form\DataTransformer\IssueToNumberTransformer;

form/dynamic_form_modification.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ Customizing the Form Type
262262
Now that you have all the basics in place you can take advantage of the ``TokenStorageInterface``
263263
and fill in the listener logic::
264264

265-
// src/AppBundle/FormType/FriendMessageFormType.php
265+
// src/AppBundle/Form/Type/FriendMessageFormType.php
266266

267267
use AppBundle\Entity\User;
268268
use Doctrine\ORM\EntityRepository;

form/events.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ callback for better readability::
317317

318318
use Symfony\Component\Form\Extension\Core\Type\TextType;
319319
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
320+
use Symfony\Component\Form\FormEvent;
320321
use Symfony\Component\Form\FormEvents;
321322

322323
// ...
@@ -404,9 +405,9 @@ Event subscribers have different uses:
404405
405406
To register the event subscriber, use the ``addEventSubscriber()`` method::
406407

408+
use AppBundle\Form\EventListener\AddEmailFieldListener;
407409
use Symfony\Component\Form\Extension\Core\Type\TextType;
408410
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
409-
use AppBundle\Form\EventListener\AddEmailFieldListener;
410411

411412
// ...
412413

security/entity_provider.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ For this entry, suppose that you already have a ``User`` entity inside an
8585
{
8686
$this->isActive = true;
8787
// may not be needed, see section on salt below
88-
// $this->salt = md5(uniqid(null, true));
88+
// $this->salt = md5(uniqid('', true));
8989
}
9090
9191
public function getUsername()

security/impersonating_user.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ to show a link to exit impersonation:
103103
</a>
104104
<?php endif ?>
105105

106-
In some cases you may need to get the object that represents the impersonating
106+
In some cases you may need to get the object that represents the impersonator
107107
user rather than the impersonated user. Use the following snippet to iterate
108108
over the user's roles until you find one that a ``SwitchUserRole`` object::
109109

@@ -115,7 +115,7 @@ over the user's roles until you find one that a ``SwitchUserRole`` object::
115115
if ($authChecker->isGranted('ROLE_PREVIOUS_ADMIN')) {
116116
foreach ($tokenStorage->getToken()->getRoles() as $role) {
117117
if ($role instanceof SwitchUserRole) {
118-
$impersonatingUser = $role->getSource()->getUser();
118+
$impersonatorUser = $role->getSource()->getUser();
119119
break;
120120
}
121121
}

0 commit comments

Comments
 (0)