File tree Expand file tree Collapse file tree 1 file changed +107
-0
lines changed
src/Standards/Squiz/Docs/Classes Expand file tree Collapse file tree 1 file changed +107
-0
lines changed Original file line number Diff line number Diff line change 1+ <documentation title =" Class Declaration" >
2+ <standard >
3+ <![CDATA[
4+ Only one interface or class is allowed in a file.
5+ ]]>
6+ </standard >
7+ <code_comparison >
8+ <code title =" Valid: One class declaration per file." >
9+ <![CDATA[
10+ class Foo implements Bar
11+ {
12+ }
13+ ]]>
14+ </code >
15+ <code title =" Invalid: More than one class or interface per file." >
16+ <![CDATA[
17+ <em>class Foo implements Bar</em>
18+ {
19+ }
20+
21+ <em>interface Bar</em>
22+ {
23+ }
24+ ]]>
25+ </code >
26+ </code_comparison >
27+ <standard >
28+ <![CDATA[
29+ No whitespace allowed before the class declaration keywords.
30+ ]]>
31+ </standard >
32+ <code_comparison >
33+ <code title =" Valid: No whitespace before class declaration keywords." >
34+ <![CDATA[
35+ <em></em>abstract class Foo
36+ {
37+ }
38+ ]]>
39+ </code >
40+ <code title =" Invalid: Whitespace before class declaration
41+ keywords." >
42+ <![CDATA[
43+ <em> </em>abstract class Foo
44+ {
45+ }
46+ ]]>
47+ </code >
48+ </code_comparison >
49+ <standard >
50+ <![CDATA[
51+ Closing brace of a class or interface must be followed by a single blank line.
52+ ]]>
53+ </standard >
54+ <code_comparison >
55+ <code title =" Valid: Single blank line after closing brace." >
56+ <![CDATA[
57+ class Foo
58+ {
59+ }
60+ <em></em>
61+ ]]>
62+ </code >
63+ <code title =" Invalid: No blank line after closing brace." >
64+ <![CDATA[
65+ class Foo
66+ {
67+ }<em></em>
68+ ]]>
69+ </code >
70+ </code_comparison >
71+ <standard >
72+ <![CDATA[
73+ Closing brace of a class or interface must be on a line by itself.
74+ ]]>
75+ </standard >
76+ <code_comparison >
77+ <code title =" Valid: Closing brace is on a line by itself." >
78+ <![CDATA[
79+ class Foo
80+ {
81+ <em>}</em>
82+ ]]>
83+ </code >
84+ <code title =" Invalid: Closing brace is not on a line by itself." >
85+ <![CDATA[
86+ class Foo
87+ {<em>}</em>
88+ ]]>
89+ </code >
90+ </code_comparison >
91+ <code_comparison >
92+ <code title =" Valid: No whitespace before closing brace." >
93+ <![CDATA[
94+ class Foo
95+ {
96+ <em>}</em>
97+ ]]>
98+ </code >
99+ <code title =" Invalid: Whitespace before closing brace." >
100+ <![CDATA[
101+ class Foo
102+ {
103+ <em> </em>}
104+ ]]>
105+ </code >
106+ </code_comparison >
107+ </documentation >
You can’t perform that action at this time.
0 commit comments