Skip to content

Commit 62e6430

Browse files
braindawgjrfnl
authored andcommitted
[Docs] Add XML doc for Squiz.Classes.ValidClassName sniff (#842)
* Add XML doc for Squiz\Classes\ValidClassName sniff * [Doc] Use em tags for ValidClassName doc XML Uses `<em>` tags in the code sample for Squiz.Classes.ValidClassName to highlight the critical part of the sample. * Clarify PascalCase class naming requirement Added a friendlier description of the PascalCase requirements. Adds an extra example to clarify that it's not just a leading capital we're looking for - we also need only letters and numbers.
1 parent b1eb334 commit 62e6430

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<documentation title="Valid Class Name">
2+
<standard>
3+
<![CDATA[
4+
Class names must be written in Pascal case. This means that it starts with a capital letter, and the first letter of each word in the class name is capitalized. Only letters and numbers are allowed.
5+
]]>
6+
</standard>
7+
<code_comparison>
8+
<code title="Valid: Class name starts with a capital letter.">
9+
<![CDATA[
10+
class <em>PascalCaseStandard</em>
11+
{
12+
}
13+
]]>
14+
</code>
15+
<code title="Invalid: Class name does not start with a capital letter.">
16+
<![CDATA[
17+
class <em>notPascalCaseStandard</em>
18+
{
19+
}
20+
]]>
21+
</code>
22+
</code_comparison>
23+
<code_comparison>
24+
<code title="Valid: Class name contains only letters and numbers.">
25+
<![CDATA[
26+
class <em>PSR7Response</em>
27+
{
28+
}
29+
]]>
30+
</code>
31+
<code title="Invalid: Class name contains underscores.">
32+
<![CDATA[
33+
class <em>PSR7_Response</em>
34+
{
35+
}
36+
]]>
37+
</code>
38+
</code_comparison>
39+
</documentation>

0 commit comments

Comments
 (0)