Skip to content

Commit fabef40

Browse files
committed
Merge branch 'master' into report-memory-improvements
Conflicts: CodeSniffer.php package.xml tests/Core/AllTests.php
2 parents e9cc524 + f3a4ecd commit fabef40

13 files changed

+1006
-1
lines changed

CodeSniffer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public static function autoload($className)
260260
// Check standard file locations based on the loaded rulesets.
261261
foreach (self::$rulesetDirs as $rulesetDir) {
262262
if (is_file(dirname($rulesetDir).'/'.$path) === true) {
263-
include dirname($rulesetDir).'/'.$path;
263+
include_once dirname($rulesetDir).'/'.$path;
264264
return;
265265
}
266266
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<documentation title="Class Declarations">
2+
<standard>
3+
<![CDATA[
4+
The opening brace of a class must be on the line after the definition by itself.
5+
]]>
6+
</standard>
7+
<code_comparison>
8+
<code title="Valid: Opening brace on the correct line.">
9+
<![CDATA[
10+
class Foo
11+
<em>{</em>
12+
}
13+
]]>
14+
</code>
15+
<code title="Invalid: Opening brace on same line as declaration.">
16+
<![CDATA[
17+
class Foo <em>{</em>
18+
}
19+
]]>
20+
</code>
21+
</code_comparison>
22+
</documentation>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
<documentation title="Class Comments">
2+
<standard>
3+
<![CDATA[
4+
Classes and interfaces must have a non-empty doc comment. The short description must be on the second line of the comment. Each description must have one blank comment line before and after. There must be one blank line before the tags in the comments. A @version tag must be in Release: package_version format.
5+
]]>
6+
</standard>
7+
<code_comparison>
8+
<code title="Valid: A doc comment for the class.">
9+
<![CDATA[
10+
<em>/**
11+
* The Foo class.
12+
*/</em>
13+
class Foo
14+
{
15+
}
16+
]]>
17+
</code>
18+
<code title="Invalid: No doc comment for the class.">
19+
<![CDATA[
20+
class Foo
21+
{
22+
}
23+
]]>
24+
</code>
25+
</code_comparison>
26+
<code_comparison>
27+
<code title="Valid: A doc comment for the class.">
28+
<![CDATA[
29+
<em>/**
30+
* The Foo class.
31+
*/</em>
32+
class Foo
33+
{
34+
}
35+
]]>
36+
</code>
37+
<code title="Invalid: Invalid comment type for the class.">
38+
<![CDATA[
39+
// The Foo class.
40+
class Foo
41+
{
42+
}
43+
]]>
44+
</code>
45+
</code_comparison>
46+
<code_comparison>
47+
<code title="Valid: A doc comment for the class.">
48+
<![CDATA[
49+
<em>/**
50+
* The Foo class.
51+
*/</em>
52+
class Foo
53+
{
54+
}
55+
]]>
56+
</code>
57+
<code title="Invalid: The blank line after the comment makes it appear as a file comment, not a class comment.">
58+
<![CDATA[
59+
<em>/**
60+
* The Foo class.
61+
*/</em>
62+
63+
class Foo
64+
{
65+
}
66+
]]>
67+
</code>
68+
</code_comparison>
69+
<code_comparison>
70+
<code title="Valid: Short description is the second line of the comment.">
71+
<![CDATA[
72+
/**
73+
* <em>The Foo class.</em>
74+
*/
75+
class Foo
76+
{
77+
}
78+
]]>
79+
</code>
80+
<code title="Invalid: An extra blank line before the short description.">
81+
<![CDATA[
82+
/**
83+
*
84+
* <em>The Foo class.</em>
85+
*/
86+
class Foo
87+
{
88+
}
89+
]]>
90+
</code>
91+
</code_comparison>
92+
<code_comparison>
93+
<code title="Valid: Exactly one blank line around descriptions.">
94+
<![CDATA[
95+
/**
96+
* The Foo class.
97+
* <em></em>
98+
* A helper for the Bar class.
99+
* <em></em>
100+
* @see Bar
101+
*/
102+
class Foo
103+
{
104+
}
105+
]]>
106+
</code>
107+
<code title="Invalid: Extra blank lines around the descriptions.">
108+
<![CDATA[
109+
/**
110+
* The Foo class.
111+
* <em></em>
112+
* <em></em>
113+
* A helper for the Bar class.
114+
* <em></em>
115+
* <em></em>
116+
* @see Bar
117+
*/
118+
class Foo
119+
{
120+
}
121+
]]>
122+
</code>
123+
</code_comparison>
124+
<code_comparison>
125+
<code title="Valid: Exactly one blank line before the tags.">
126+
<![CDATA[
127+
/**
128+
* The Foo class.
129+
* <em></em>
130+
* @see Bar
131+
*/
132+
class Foo
133+
{
134+
}
135+
]]>
136+
</code>
137+
<code title="Invalid: Extra blank lines before the tags.">
138+
<![CDATA[
139+
/**
140+
* The Foo class.
141+
* <em></em>
142+
* <em></em>
143+
* @see Bar
144+
*/
145+
class Foo
146+
{
147+
}
148+
]]>
149+
</code>
150+
</code_comparison>
151+
<code_comparison>
152+
<code title="Valid: Version tag is in the correct format.">
153+
<![CDATA[
154+
/**
155+
* The Foo class.
156+
*
157+
* @version <em>Release: 1.0</em>
158+
*/
159+
class Foo
160+
{
161+
}
162+
]]>
163+
</code>
164+
<code title="Invalid: No Release: text.">
165+
<![CDATA[
166+
/**
167+
* The Foo class.
168+
*
169+
* @version <em>1.0</em>
170+
*/
171+
class Foo
172+
{
173+
}
174+
]]>
175+
</code>
176+
</code_comparison>
177+
</documentation>

0 commit comments

Comments
 (0)