<?xml version="1.0"?>
<ruleset name="php-mqtt Code Style Standard">
    <description>php-mqtt Code Style Standard</description>

    <rule ref="PSR1"/>
    <rule ref="PSR2">
        <exclude name="PSR2.Methods.MethodDeclaration.AbstractAfterVisibility"/>
        <exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis"/>
    </rule>

    <rule ref="Generic.Arrays.ArrayIndent">
        <exclude name="Generic.Arrays.ArrayIndent.CloseBraceNotNewLine"/>
    </rule>
    <rule ref="Generic.Classes.DuplicateClassName"/>
    <rule ref="Generic.CodeAnalysis.EmptyStatement">
        <exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/>
    </rule>
    <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
    <rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
    <rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
    <rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
    <rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
    <rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
    <rule ref="Generic.Commenting.Todo">
        <exclude-pattern>src/*</exclude-pattern>
    </rule>
    <rule ref="Generic.ControlStructures.InlineControlStructure"/>
    <rule ref="Generic.Files.ByteOrderMark"/>
    <rule ref="Generic.Files.LineEndings"/>
    <rule ref="Generic.Files.LineLength">
        <properties>
            <property name="lineLimit" value="150"/>
            <property name="absoluteLineLimit" value="0"/>
        </properties>
    </rule>
    <rule ref="Generic.Formatting.DisallowMultipleStatements"/>
    <rule ref="Generic.Formatting.MultipleStatementAlignment"/>
    <rule ref="Generic.Formatting.SpaceAfterCast"/>
    <rule ref="Generic.Functions.CallTimePassByReference"/>
    <rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
    <rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/>
    <rule ref="Generic.Metrics.CyclomaticComplexity">
        <properties>
            <property name="complexity" value="50"/>
            <property name="absoluteComplexity" value="100"/>
        </properties>
    </rule>
    <rule ref="Generic.Metrics.NestingLevel">
        <properties>
            <property name="nestingLevel" value="10"/>
            <property name="absoluteNestingLevel" value="30"/>
        </properties>
    </rule>
    <rule ref="Generic.NamingConventions.ConstructorName"/>
    <rule ref="Generic.PHP.LowerCaseConstant"/>
    <rule ref="Generic.PHP.DeprecatedFunctions"/>
    <rule ref="Generic.PHP.DisallowShortOpenTag"/>
    <rule ref="Generic.PHP.ForbiddenFunctions"/>
    <rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
    <rule ref="Generic.WhiteSpace.ScopeIndent">
        <properties>
            <property name="indent" value="4"/>
        </properties>
    </rule>
    <rule ref="MySource.PHP.EvalObjectFactory"/>
    <rule ref="PEAR.Commenting.ClassComment">
        <exclude name="PEAR.Commenting.ClassComment.MissingAuthorTag"/>
        <exclude name="PEAR.Commenting.ClassComment.MissingCategoryTag"/>
        <exclude name="PEAR.Commenting.ClassComment.MissingLicenseTag"/>
        <exclude name="PEAR.Commenting.ClassComment.MissingLinkTag"/>
    </rule>
    <rule ref="PEAR.Commenting.ClassComment.Missing"/>
    <rule ref="PEAR.Commenting.ClassComment.MissingPackageTag"/>
    <rule ref="PEAR.Commenting.InlineComment"/>
    <rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
    <rule ref="PSR2.Methods.FunctionClosingBrace.SpacingBeforeClose"/>
    <rule ref="Squiz.Arrays.ArrayDeclaration.NoCommaAfterLast"/>
    <rule ref="Squiz.Functions.MultiLineFunctionDeclaration.NewlineBeforeOpenBrace">
        <exclude-pattern>src/*</exclude-pattern>
    </rule>
    <rule ref="Zend.Files.ClosingTag"/>

    <file>src</file>

    <arg name="colors"/>
    <arg value="sp"/>
    <ini name="memory_limit" value="128M"/>
</ruleset>