Skip to content

Commit 814b20f

Browse files
committed
coding standard: added enums.php convention
1 parent cdd5e0f commit 814b20f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

contributing/cs/coding-standard.texy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Obecná pravidla
1414
- Dva prázdné řádky se používají k oddělení metod pro lepší čitelnost.
1515
- Důvod použití shut-up operátoru musí být zdokumentován: `@mkdir($dir); // @ - adresář může existovat`.
1616
- Pokud je použit slabě typizovaný operátor porovnání (tj. `==`, `!=`, ...), musí být zdokumentován záměr: `// == přijmout null`
17-
- Do jednoho souboru `exceptions.php` můžete zapsat více výjimek.
17+
- Do jednoho souboru `exceptions.php` můžete zapsat více výjimek, do souboru `enums.php` více enumů.
1818
- U rozhraní se nespecifikuje viditelnost metod, protože jsou vždy veřejné.
1919
- Každá property, návratová hodnota a parametr musí mít uvedený typ. Naopak u finálních konstant typ nikdy neuvádíme, protože je zjevný.
2020
- K ohraničení řetězce by se měly používat jednoduché uvozovky, s výjimkou případů, kdy samotný literál obsahuje apostrofy.

contributing/en/coding-standard.texy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ General Rules
1414
- Two empty lines are used to separate methods for better readability
1515
- The reason for using the shut-up operator (`@`) must be documented: `@mkdir($dir); // @ - directory may exist`
1616
- If a weak typed comparison operator is used (i.e., `==`, `!=`, ...), the intention must be documented: `// == to accept null`
17-
- You can write multiple exception classes into a single file named `exceptions.php`
17+
- You can write multiple exception classes into a single file named `exceptions.php`, and multiple enums into `enums.php`
1818
- The visibility of methods is not specified for interfaces because they are always public
1919
- Each property, return value, and parameter must have a type specified. Conversely, for final constants, we never specify the type because it is obvious
2020
- Single quotes should be used to delimit strings, except when the literal itself contains apostrophes

0 commit comments

Comments
 (0)