Skip to content

Commit d912036

Browse files
committed
Merge branch '4.4' into 5.4
* 4.4: Document code-style for enums and class constants
2 parents 309abf8 + 3ce2c1a commit d912036

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

contributing/code/standards.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,12 @@ Naming Conventions
206206
* Use `snake_case`_ for configuration parameters and Twig template variables
207207
(e.g. ``framework.csrf_protection``, ``http_status_code``);
208208

209-
* Use namespaces for all PHP classes and `UpperCamelCase`_ for their names (e.g.
210-
``ConsoleLogger``);
209+
* Use `SCREAMING_SNAKE_CASE`_ for constants (e.g. ``InputArgument::IS_ARRAY``);
210+
211+
* Use `UpperCamelCase`_ for enumeration cases (e.g. ``InputArgumentMode::IsArray``);
212+
213+
* Use namespaces for all PHP classes, interfaces, traits and enums and
214+
`UpperCamelCase`_ for their names (e.g. ``ConsoleLogger``);
211215

212216
* Prefix all abstract classes with ``Abstract`` except PHPUnit ``*TestCase``.
213217
Please note some early Symfony classes do not follow this convention and
@@ -218,6 +222,9 @@ Naming Conventions
218222

219223
* Suffix traits with ``Trait``;
220224

225+
* Don't use a dedicated suffix for classes or enumerations (e.g. like ``Class``
226+
or ``Enum``), except for the cases listed below.
227+
221228
* Suffix exceptions with ``Exception``;
222229

223230
* Prefix PHP attributes with ``As`` where applicable (e.g. ``#[AsCommand]``

0 commit comments

Comments
 (0)