Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Squiz ClassDeclarationStandard.xml #3897

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions package.xml
Expand Up @@ -1519,6 +1519,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
<file baseinstalldir="PHP/CodeSniffer" name="ArrayDeclarationStandard.xml" role="php" />
</dir>
<dir name="Classes">
<file baseinstalldir="PHP/CodeSniffer" name="ClassDeclarationStandard.xml" role="php" />
<file baseinstalldir="PHP/CodeSniffer" name="LowercaseClassKeywordsStandard.xml" role="php" />
<file baseinstalldir="PHP/CodeSniffer" name="SelfMemberReferenceStandard.xml" role="php" />
</dir>
Expand Down
23 changes: 23 additions & 0 deletions src/Standards/Squiz/Docs/Classes/ClassDeclarationStandard.xml
@@ -0,0 +1,23 @@
<documentation title="Class Declaration">
<standard>
<![CDATA[
This extends the PSR2 standard, adding to the requirements for the 'SpaceBeforeKeyword' code. It ensures that keywords like 'class' do not have a space before them.
]]>
</standard>
<code_comparison>
<code title="Valid: Class Declaration.">
<![CDATA[
class<em> </em>Foo
{
}
]]>
</code>
<code title="Invalid: Class Declaration.">
<![CDATA[
class<em> </em>Foo
{
}
]]>
</code>
</code_comparison>
</documentation>