File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed
src/Standards/PSR12/Docs/ControlStructures Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ <documentation title =" Boolean Operator Placement" >
2+ <standard >
3+ <![CDATA[
4+ Boolean operators between conditions MUST always be at the beginning or at the end of the line, not a mix of both.
5+ ]]>
6+ </standard >
7+ <code_comparison >
8+ <code title =" Valid: Boolean operator between conditions at the beginning of the line." >
9+ =<![CDATA[
10+ if (
11+ $expr1
12+ && $expr2
13+ && ($expr3
14+ || $expr4)
15+ && $expr5
16+ ) {
17+ // if body.
18+ }
19+ ]]>
20+ </code >
21+ <code title =" Invalid: Boolean operators between conditions at the beginning and the end of the line." >
22+ <![CDATA[
23+ if (
24+ $expr1 &&
25+ ($expr2 || $expr3)
26+ && $expr4
27+ ) {
28+ // if body.
29+ }
30+ ]]>
31+ </code >
32+ </code_comparison >
33+ <code_comparison >
34+ <code title =" Valid: Boolean operator between conditions at the end of the line." >
35+ <![CDATA[
36+ if (
37+ $expr1 &&
38+ ($expr2 || $expr3) &&
39+ $expr4
40+ ) {
41+ // if body.
42+ }
43+ ]]>
44+ </code >
45+ <code title =" Invalid: Boolean operators between conditions at the beginning and the end of the line." >
46+ <![CDATA[
47+ match (
48+ $expr1
49+ && $expr2 &&
50+ $expr3
51+ ) {
52+ // structure body.
53+ };
54+ ]]>
55+ </code >
56+ </code_comparison >
57+ </documentation >
You can’t perform that action at this time.
0 commit comments