@@ -199,12 +199,14 @@ Structure
199199Naming Conventions
200200~~~~~~~~~~~~~~~~~~
201201
202- * Use camelCase, not underscores, for variable , function and method
203- names, arguments ;
202+ * Use ` camelCase `_ for PHP variables , function and method names, arguments
203+ (e.g. `` $acceptableContentTypes ``, `` hasSession() ``) ;
204204
205- * Use underscores for configuration options and parameters;
205+ * Use `snake_case `_ for configuration parameters and Twig template variables
206+ (e.g. ``framework.csrf_protection ``, ``http_status_code ``);
206207
207- * Use namespaces for all classes;
208+ * Use namespaces for all PHP classes and `UpperCamelCase `_ for their names (e.g.
209+ ``ConsoleLogger ``);
208210
209211* Prefix all abstract classes with ``Abstract `` except PHPUnit ``*TestCase ``.
210212 Please note some early Symfony classes do not follow this convention and
@@ -217,7 +219,9 @@ Naming Conventions
217219
218220* Suffix exceptions with ``Exception ``;
219221
220- * Use alphanumeric characters and underscores for file names;
222+ * Use UpperCamelCase for naming PHP files (e.g. ``EnvVarProcessor.php ``) and
223+ snake case for naming Twig templates and web assets (``section_layout.html.twig ``,
224+ ``index.scss ``);
221225
222226* For type-hinting in PHPDocs and casting, use ``bool `` (instead of ``boolean ``
223227 or ``Boolean ``), ``int `` (instead of ``integer ``), ``float `` (instead of
@@ -280,3 +284,6 @@ License
280284.. _`PSR-4` : https://www.php-fig.org/psr/psr-4/
281285.. _`identical comparison` : https://php.net/manual/en/language.operators.comparison.php
282286.. _`Yoda conditions` : https://en.wikipedia.org/wiki/Yoda_conditions
287+ .. _`camelCase` : https://en.wikipedia.org/wiki/Camel_case
288+ .. _`UpperCamelCase` : https://en.wikipedia.org/wiki/Camel_case
289+ .. _`snake_case` : https://en.wikipedia.org/wiki/Snake_case
0 commit comments