Skip to content

Commit

Permalink
Merge branch '2.7' into 2.8
Browse files Browse the repository at this point in the history
* 2.7:
  Update rendering.rst
  remove part about adding extension
  Add "allowed_classes" argument for unserialize()
  Fix "class_exists" PHP function URL
  Fix typo in method setETag. Correct method name is setEtag
  Minor changes to the previous merge
  Rewrite the gender-neutral pronoun section to reflect an inclusive viewpoint for everyone
  Update controller.rst
  Add cautionary advice about SQL reserved words
  Removed an internal detail about route placeholders
  • Loading branch information
xabbuh committed Apr 9, 2018
2 parents c11dd42 + 65898f6 commit 51f72ff
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 26 deletions.
18 changes: 10 additions & 8 deletions contributing/community/review-comments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,18 @@ that, but swearing/cursing and name calling doesn't really encourage anyone to
help you. Take a deep breath, count to 10 and try to *clearly* explain what problems
you encounter.

Gender-neutral Pronouns
-----------------------
Inclusive Language
------------------

While not "formally" required, it's better to use gender-neutral pronouns.
Unless someone "indicated" their pronouns, use "they", "them" instead of
"he", "she", "his", "hers", "his/hers", "he/she", etc.
In an effort to be inclusive to a wide group of people, it's recommended to
use personal pronouns that don't suggest a particular gender. Unless someone
has stated their pronouns, use "they", "them" instead of "he", "she", "his",
"hers", "his/hers", "he/she", etc.

Try to avoid using wording that may be considered excluding and needlessly gendered,
like for example words that have a male base. For example we recommend to use other
words like "folks", "team", "everyone" in place of "guys".
Try to avoid using wording that may be considered excluding, needlessly gendered
(e.g. words that have a male or female base), racially motivated or singles out
a particular group in society. For example, it's recommended to use words like
"folks", "team", "everyone" instead of "guys", "ladies", "yanks", etc.

Giving Positive Feedback
------------------------
Expand Down
4 changes: 2 additions & 2 deletions controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,14 @@ method renders a template **and** puts that content into a ``Response``
object for you::

// renders app/Resources/views/lucky/number.html.twig
return $this->render('lucky/number.html.twig', array('name' => $name));
return $this->render('lucky/number.html.twig', array('number' => $number));

Templates can also live in deeper sub-directories. Just try to avoid
creating unnecessarily deep structures::

// renders app/Resources/views/lottery/lucky/number.html.twig
return $this->render('lottery/lucky/number.html.twig', array(
'name' => $name,
'number' => $number,
));

The Symfony templating system and Twig are explained more in the
Expand Down
2 changes: 1 addition & 1 deletion doctrine/mapping_model_classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ be adapted for your case::
}
}

Note the :phpfunction:`class_exists()` check. This is crucial, as you do not want your
Note the :phpfunction:`class_exists` check. This is crucial, as you do not want your
bundle to have a hard dependency on all Doctrine bundles but let the user
decide which to use.

Expand Down
2 changes: 1 addition & 1 deletion form/rendering.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ of code. Of course, you'll usually need much more flexibility when rendering:

.. code-block:: html+php

<!-- app/Resources/views/default/newAction.html.php -->
<!-- app/Resources/views/default/new.html.php -->
<?php echo $view['form']->start($form) ?>
<?php echo $view['form']->errors($form) ?>

Expand Down
2 changes: 1 addition & 1 deletion http_cache/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ exposing a simple and efficient pattern::

// create a Response with an ETag and/or a Last-Modified header
$response = new Response();
$response->setETag($article->computeETag());
$response->setEtag($article->computeETag());
$response->setLastModified($article->getPublishedAt());

// Set response as public. Otherwise it will be private by default.
Expand Down
4 changes: 0 additions & 4 deletions routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -466,10 +466,6 @@ a slash. URLs matching this route might look like:
Symfony provides you with a way to do this by leveraging service container
parameters. Read more about this in ":doc:`/routing/service_container_parameters`".

.. caution::

A route placeholder name cannot start with a digit and cannot be longer than 32 characters.

Special Routing Parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
10 changes: 9 additions & 1 deletion security/entity_provider.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,20 @@ For this entry, suppose that you already have a ``User`` entity inside an
$this->password,
// see section on salt below
// $this->salt
) = unserialize($serialized);
) = unserialize($serialized, ['allowed_classes' => false]);
}
}

To make things shorter, some of the getter and setter methods aren't shown.
But you can generate these manually or with your own IDE.

.. caution::

In the example above, the User entity's table name is "app_users" because
"USER" is a SQL reserved word. If you wish to call your table name "user",
`it must be quoted with backticks`_ to avoid errors. The annotation should
look like ``@ORM\Table(name="`user`")``.

Next, make sure to :ref:`create the database table <doctrine-creating-the-database-tables-schema>`:

.. code-block:: terminal
Expand Down Expand Up @@ -551,3 +558,4 @@ or worry about it.

.. _fixtures: https://symfony.com/doc/master/bundles/DoctrineFixturesBundle/index.html
.. _FOSUserBundle: https://github.com/FriendsOfSymfony/FOSUserBundle
.. _`it must be quoted with backticks`: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/basic-mapping.html#quoting-reserved-words
8 changes: 0 additions & 8 deletions validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -509,14 +509,6 @@ of the form fields::
;
}

The ``constraints`` option is only available if the ``ValidatorExtension``
was enabled through the form factory builder::

Forms::createFormFactoryBuilder()
->addExtension(new ValidatorExtension(Validation::createValidator()))
->getFormFactory()
;

.. index::
single: Validation; Constraint targets

Expand Down

0 comments on commit 51f72ff

Please sign in to comment.