Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 433e296

Browse filesBrowse files
committed
Merge branch '3.4' into 4.1
* 3.4: Replace "set leave" with leave only Improved the explanation of naming in PHP and Twig
2 parents 66bdb02 + 543bfb4 commit 433e296
Copy full SHA for 433e296

File tree

2 files changed

+13
-6
lines changed
Filter options

2 files changed

+13
-6
lines changed

‎contributing/code/standards.rst

Copy file name to clipboardExpand all lines: contributing/code/standards.rst
+12-5Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,14 @@ Structure
199199
Naming 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

‎reference/constraints/Image.rst

Copy file name to clipboardExpand all lines: reference/constraints/Image.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ allowSquare
312312
**type**: ``Boolean`` **default**: ``true``
313313

314314
If this option is false, the image cannot be a square. If you want to force
315-
a square image, then set leave this option as its default ``true`` value
315+
a square image, then leave this option as its default ``true`` value
316316
and set `allowLandscape`_ and `allowPortrait`_ both to ``false``.
317317

318318
allowLandscape

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.