File tree Expand file tree Collapse file tree 1 file changed +58
-4
lines changed
src/Standards/PEAR/Docs/Classes Expand file tree Collapse file tree 1 file changed +58
-4
lines changed Original file line number Diff line number Diff line change 1- <documentation title =" Class Declarations " >
1+ <documentation title =" Class Declaration " >
22 <standard >
33 <![CDATA[
4- The opening brace of a class must be on the line after the definition by itself.
4+ The opening brace of an OO structure must be on the line directly after the OO signature. The opening brace must be on a line by itself.
55 ]]>
66 </standard >
77 <code_comparison >
@@ -12,10 +12,64 @@ class Foo
1212}
1313 ]]>
1414 </code >
15- <code title =" Invalid: Opening brace on same line as declaration ." >
15+ <code title =" Invalid: Opening brace on incorrect line." >
1616 <![CDATA[
17- class Foo <em>{</em>
17+ class BraceOnSignatureLine <em>{</em>
1818}
19+
20+ class BlankLineBetween
21+ <em></em>
22+ {
23+ }
24+ ]]>
25+ </code >
26+ </code_comparison >
27+ <code_comparison >
28+ <code title =" Valid: Opening brace is on a line by itself." >
29+ <![CDATA[
30+ class Foo
31+ <em>{</em>
32+ }
33+ ]]>
34+ </code >
35+ <code title =" Invalid: Opening brace is not on a line by itself." >
36+ <![CDATA[
37+ class Foo
38+ {<em> public function __construct() {}</em>
39+ }
40+ ]]>
41+ </code >
42+ </code_comparison >
43+ <standard >
44+ <![CDATA[
45+ The opening brace must be indented to the same depth as the OO structure's declaration.
46+ ]]>
47+ </standard >
48+ <code_comparison >
49+ <code title =" Valid: Opening brace indentation depth matches the OO structure signature's depth." >
50+ <![CDATA[
51+ if (!class_exists('IndentedFourSpaces')) {
52+ abstract class IndentedFourSpaces
53+ <em>{</em>
54+ }
55+ }
56+
57+ class NotIndented
58+ <em>{</em>
59+ }
60+ ]]>
61+ </code >
62+ <code title =" Invalid: Opening brace indentation depth does not match the OO structure signature's depth." >
63+ <![CDATA[
64+ if (!class_exists('IndentedFourSpaces')) {
65+ abstract class IndentedFourSpaces
66+ <em>{</em>
67+ }
68+ }
69+
70+ class NotIndented
71+ <em>{</em>
72+ }
1973 ]]>
2074 </code >
2175 </code_comparison >
You can’t perform that action at this time.
0 commit comments