Skip to content

Instantly share code, notes, and snippets.

@Ovsyanka
Forked from gsherwood/ruleset.xml
Last active February 20, 2020 11:10
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Ovsyanka/e2ab2ff76e7c0d7e75a1e4213a03ff95 to your computer and use it in GitHub Desktop.
Save Ovsyanka/e2ab2ff76e7c0d7e75a1e4213a03ff95 to your computer and use it in GitHub Desktop.
PSR2 with tabs instead of spaces and bracers on the end of lines
<?xml version="1.0"?>
<ruleset name="MyStandard">
<description>
PSR2 with changes:
* tabs instead of spaces (https://gist.github.com/gsherwood/9d22f634c57f990a7c64)
* bracers on end of line instead new line
</description>
<!-- tabs -->
<arg name="tab-width" value="4"/>
<rule ref="PSR2">
<!-- bracers -->
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine" />
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine" />
<!-- tabs -->
<exclude name="Generic.WhiteSpace.DisallowTabIndent"/>
</rule>
<!-- tabs -->
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="4"/>
<property name="tabIndent" value="true"/>
</properties>
</rule>
<!-- bracers -->
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie" />
<rule ref="Generic.Classes.OpeningBraceSameLine"/>
</ruleset>
@kirrie
Copy link

kirrie commented Mar 7, 2017

thanks for new ruleset. it works as expected for my phpcs.

@mtness
Copy link

mtness commented May 15, 2017

Thank you, this is exactly what I was looking for!

@DRSDavidSoft
Copy link

Thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment