Skip to content

Commit

Permalink
Clarify PascalCase class naming requirement
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
braindawg authored and jrfnl committed Mar 3, 2025
1 parent af33b4a commit 916b5f8
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/Standards/Squiz/Docs/Classes/ValidClassNameStandard.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<documentation title="Valid Class Name">
<standard>
<![CDATA[
Class names must be written in Pascal case.
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.
]]>
</standard>
<code_comparison>
<code title="Valid: Class name is written in Pascal case.">
<code title="Valid: Class name starts with a capital letter.">
<![CDATA[
class <em>PascalCaseStandard</em>
{
Expand All @@ -19,5 +19,21 @@ class <em>notPascalCaseStandard</em>
}
]]>
</code>
</code_comparison>
</code_comparison>
<code_comparison>
<code title="Valid: Class name contains only letters and numbers.">
<![CDATA[
class <em>PSR7Response</em>
{
}
]]>
</code>
<code title="Invalid: Class name contains underscores.">
<![CDATA[
class <em>PSR7_Response</em>
{
}
]]>
</code>
</code_comparison>
</documentation>

0 comments on commit 916b5f8

Please sign in to comment.