You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41-2Lines changed: 41 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,13 +17,52 @@ The MO4 Coding Standard is an extension of the [Symfony Coding Standard](http://
17
17
* in associative arrays, the `=>` operators must be aligned
18
18
* in arrays, the key and `=>` operator must be on the same line
19
19
* each consecutive variable assignment must align at the assignment operator
20
-
* use statements must be sorted lexicographically
20
+
* use statements must be sorted lexicographically, grouped by empty lines. The order function can be configured.
21
21
* you should use the imported class name when it was imported with a use statement
22
22
* interpolated variables in double quoted strings must be surrounded by `{ }`, e.g. `{$VAR}` instead of `$VAR`
23
-
*`sprintf` or `"{$VAR1} {$VAR2}"` must be used instead of the dot operator; concat operators are only allowed to concatenate constants and multi line strings,
23
+
*`sprintf` or `"{$VAR1} {$VAR2}"` must be used instead of the dot operator; concat operators are only allowed to concatenate constants and multi line strings
24
24
* a whitespace is required after each typecast, e.g. `(int) $value` instead of `(int)$value`
25
25
* doc blocks of class properties must be multiline and have exactly one `@var` annotation
26
26
27
+
## Configuration
28
+
29
+
### MO4.Formatting.AlphabeticalUseStatements
30
+
31
+
The `order` property of the `MO4.Formatting.AlphabeticalUseStatements` sniff defines
32
+
which function is used for ordering.
33
+
34
+
Possible values for order:
35
+
*`dictionary` (default): based on [strcmp](http://php.net/strcmp), the namespace separator
36
+
precedes any other character
37
+
```php
38
+
use Doctrine\ORM\Query;
39
+
use Doctrine\ORM\Query\Expr;
40
+
use Doctrine\ORM\QueryBuilder;
41
+
```
42
+
*`string`: binary safe string comparison using [strcmp](http://php.net/strcmp)
43
+
```php
44
+
use Doctrine\ORM\Query;
45
+
use Doctrine\ORM\QueryBuilder;
46
+
use Doctrine\ORM\Query\Expr;
47
+
48
+
use ExampleSub;
49
+
use Examples;
50
+
```
51
+
*`string-locale`: locale based string comparison using [strcoll](http://php.net/strcoll)
0 commit comments