steffen-wirth
4/25/2016 - 5:41 AM

Php Codesniffer Ruleset https://github.com/madedotcom/phpcs-magento-rules

<?xml version="1.0"?>
<ruleset name="Made">
    <description>made.com coding standards</description>

    <!-- Like a magpie, we take lots of stuff -->
    <rule ref="Generic.Classes.DuplicateClassName"/>
    <rule ref="Generic.CodeAnalysis.EmptyStatement"/>
    <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
    <rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
    <rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
    <rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
    <rule ref="Generic.Commenting.Todo"/>
    <rule ref="Generic.ControlStructures.InlineControlStructure"/>
    <rule ref="Generic.Files.ByteOrderMark"/>
    <rule ref="Generic.Files.LineEndings"/>
    <rule ref="Generic.Files.LineLength"/>
    <rule ref="Generic.Formatting.DisallowMultipleStatements"/>
    <rule ref="Generic.Formatting.SpaceAfterCast"/>
    <rule ref="Generic.Metrics.CyclomaticComplexity"/>
    <rule ref="Generic.Metrics.NestingLevel"/>
    <rule ref="Generic.NamingConventions.ConstructorName"/>
    <rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
    <rule ref="Generic.PHP.DeprecatedFunctions"/>
    <rule ref="Generic.PHP.DisallowShortOpenTag"/>
    <rule ref="Generic.PHP.ForbiddenFunctions"/>
    <rule ref="Generic.PHP.LowerCaseConstant"/>
    <rule ref="Generic.PHP.NoSilencedErrors"/>
    <rule ref="Generic.WhiteSpace.ScopeIndent"/>
    <rule ref="Generic.Functions.CallTimePassByReference"/>
    <rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
    <rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/>
    <rule ref="PEAR.Classes.ClassDeclaration"/>
    <rule ref="PEAR.Commenting.ClassComment"/>
    <rule ref="PEAR.Commenting.FileComment"/>
    <rule ref="PEAR.Commenting.FunctionComment"/>
    <rule ref="PEAR.Commenting.InlineComment"/>
    <rule ref="PEAR.ControlStructures.ControlSignature"/>
    <rule ref="PEAR.ControlStructures.MultiLineCondition"/>
    <rule ref="PEAR.Functions.FunctionCallSignature"/>
    <rule ref="PEAR.Functions.FunctionDeclaration"/>
    <rule ref="PEAR.Functions.ValidDefaultValue"/>
    <rule ref="PEAR.WhiteSpace.ObjectOperatorIndent"/>
    <rule ref="PEAR.WhiteSpace.ScopeClosingBrace"/>
    <rule ref="Squiz.Functions.GlobalFunction"/>
    <rule ref="Squiz.Commenting.FunctionCommentThrowTag"/>
    <rule ref="Squiz.Operators.IncrementDecrementUsage"/>
    <rule ref="Squiz.Operators.ValidLogicalOperators"/>
    <rule ref="Squiz.PHP.CommentedOutCode"/>
    <rule ref="Squiz.Scope.MemberVarScope"/>
    <rule ref="Squiz.Scope.MethodScope"/>
    <rule ref="Squiz.Scope.StaticThisUsage"/>
    <rule ref="Squiz.Strings.EchoedStrings"/>

    <!-- We even make our own! -->

    <rule ref="Made.Magento.Log"/>

    <!-- Lines can be 80 chars long, show errors at 120 chars -->
    <rule ref="Generic.Files.LineLength">
        <properties>
            <property name="lineLimit" value="80"/>
            <property name="absoluteLineLimit" value="120"/>
        </properties>
    </rule>

    <!-- Use Unix newlines -->
    <rule ref="Generic.Files.LineEndings">
        <properties>
            <property name="eolChar" value="\n"/>
        </properties>
    </rule>

</ruleset>