Skip to content

Commit 254f501

Browse files
committed
minor symfony#8995 Mention that PSR-1 doesn't recommend CamelCase or anything else (javiereguiluz)
This PR was squashed before being merged into the 2.7 branch (closes symfony#8995). Discussion ---------- Mention that PSR-1 doesn't recommend CamelCase or anything else This fixes symfony#8991. Commits ------- 8ad93aa Mention that PSR-1 doesn't recommend CamelCase or anything else
2 parents 2678b52 + 8ad93aa commit 254f501

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

components/serializer.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,9 @@ CamelCase to snake_case
421421
interface was introduced in Symfony 2.7.
422422

423423
In many formats, it's common to use underscores to separate words (also known
424-
as snake_case). However, PSR-1 specifies that the preferred style for PHP
425-
properties and methods is CamelCase.
424+
as snake_case). However, in Symfony applications is common to use CamelCase to
425+
name properties (even though the `PSR-1 standard`_ doesn't recommend any
426+
specific case for property names).
426427

427428
Symfony provides a built-in name converter designed to transform between
428429
snake_case and CamelCased styles during serialization and deserialization
@@ -646,5 +647,6 @@ Learn more
646647
A popular alternative to the Symfony Serializer Component is the third-party
647648
library, `JMS serializer`_ (released under the Apache license, so incompatible with GPLv2 projects).
648649

650+
.. _`PSR-1 standard`: http://www.php-fig.org/psr/psr-1/
649651
.. _`JMS serializer`: https://github.com/schmittjoh/serializer
650652
.. _Packagist: https://packagist.org/packages/symfony/serializer

0 commit comments

Comments
 (0)