Skip to content

Instantly share code, notes, and snippets.

@lorisleiva
Last active May 4, 2019 14:42
Show Gist options
  • Save lorisleiva/941277c8099672d734f68e03eb6418f7 to your computer and use it in GitHub Desktop.
Save lorisleiva/941277c8099672d734f68e03eb6418f7 to your computer and use it in GitHub Desktop.
The default PHP Code Style of my Laravel projects.
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Laravel">
<description>The default PHP Code Style of my Laravel projects.</description>
<!-- Files to include. -->
<file>app</file>
<file>config</file>
<file>routes</file>
<file>tests</file>
<!-- Console arguments. -->
<arg name="report" value="summary"/>
<arg name="colors"/>
<arg value="p"/>
<!-- Include the whole PSR-2 standard. -->
<rule ref="PSR2"/>
<!-- Allow only test methods to be snake cased. -->
<rule ref="PSR1.Methods.CamelCapsMethodName">
<exclude-pattern>tests/**/*Test.php</exclude-pattern>
</rule>
<!-- Include some Generic rules. -->
<rule ref="Generic.Classes.DuplicateClassName"/>
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
<rule ref="Generic.Formatting.SpaceAfterCast"/>
<rule ref="Generic.NamingConventions.ConstructorName"/>
<rule ref="Generic.Metrics.NestingLevel">
<properties>
<property name="nestingLevel" value="2"/>
<property name="absoluteNestingLevel" value="2"/>
</properties>
</rule>
</ruleset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment