Skip to content

Mention that PSR-1 doesn't recommend CamelCase or anything else #8995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions components/serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,9 @@ CamelCase to snake_case
interface was introduced in Symfony 2.7.

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

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

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