<?xml version="1.0"?>
<ruleset name="MyRuleset">
    <description>Coding standard based on internal Braintree coding practices.</description>

    <!-- PSR-12 is the latest PHP published standard for code style.
         This ruleset includes PSR1 & 2 -->
		<rule ref="PSR12"/>

    <!-- Exclude some rules -->
    <!-- This rule pops up for Braintree.php and test files,
         and aren't really that smelly for those instances -->
    <rule ref="PSR1.Files.SideEffects">
        <exclude name="PSR1.Files.SideEffects"/>
    </rule>

    <!-- Our tests use a syntax `methodname_doesAThingWeTest` so let's ignore -->
    <rule ref="PSR1.Methods.CamelCapsMethodName">
      <exclude-pattern>tests/*</exclude-pattern>
    </rule>

    <rule ref="Generic.Files.LineLength">
      <exclude-pattern>tests/*</exclude-pattern>
    </rule>

    <!-- We mark internal properties and methods with `_`
         so let's ignore these two rules to save ignore comment lines -->
    <rule ref="PSR2.Classes.PropertyDeclaration">
        <exclude name="PSR2.Classes.PropertyDeclaration"/>
    </rule>

    <rule ref="PSR2.Methods.MethodDeclaration">
        <exclude name="PSR2.Methods.MethodDeclaration"/>
    </rule>

		<!-- NEXT_MAJOR_VERSION remove this rule and add visibility modifiers,
				 https://www.php.net/manual/en/language.oop5.constants.php -->
    <rule ref="PSR12.Properties.ConstantVisibility">
        <exclude name="PSR12.Properties.ConstantVisibility"/>
    </rule>
</ruleset>
