phpcs.xml.dist 4.17 KB
Newer Older
Luís Cobucci's avatar
Luís Cobucci committed
1 2 3 4 5 6
<?xml version="1.0"?>
<ruleset>
    <arg name="basepath" value="."/>
    <arg name="extensions" value="php"/>
    <arg name="parallel" value="80"/>
    <arg name="cache" value=".phpcs-cache"/>
7
    <arg name="colors"/>
Luís Cobucci's avatar
Luís Cobucci committed
8

9 10
    <!-- Ignore warnings, show progress of the run and show sniff names -->
    <arg value="nps"/>
Luís Cobucci's avatar
Luís Cobucci committed
11

12
    <file>bin</file>
Luís Cobucci's avatar
Luís Cobucci committed
13 14 15
    <file>lib</file>
    <file>tests</file>

16
    <rule ref="Doctrine">
17 18
        <exclude name="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming"/>
        <exclude name="SlevomatCodingStandard.Classes.SuperfluousExceptionNaming"/>
19 20
        <exclude name="SlevomatCodingStandard.ControlStructures.ControlStructureSpacing.IncorrectLinesCountAfterLastControlStructure"/>
        <exclude name="SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants.DisallowedLateStaticBindingForConstant"/>
21
    </rule>
Luís Cobucci's avatar
Luís Cobucci committed
22 23 24 25 26

    <rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
        <exclude-pattern>*/tests/*</exclude-pattern>
    </rule>

27 28 29 30
    <rule ref="Squiz.Classes.ClassFileName.NoMatch">
        <exclude-pattern>*/tests/*</exclude-pattern>
    </rule>

Luís Cobucci's avatar
Luís Cobucci committed
31 32 33
    <rule ref="Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase">
        <exclude-pattern>lib/Doctrine/DBAL/Events.php</exclude-pattern>
    </rule>
34 35 36 37

    <rule ref="SlevomatCodingStandard.Classes.UnusedPrivateElements.UnusedProperty">
        <exclude-pattern>tests/Doctrine/Tests/DBAL/Tools/TestAsset/*</exclude-pattern>
    </rule>
38

39 40 41 42
    <!-- see https://github.com/squizlabs/PHP_CodeSniffer/issues/2099 -->
    <rule ref="Squiz.Commenting.FunctionComment.InvalidNoReturn">
        <exclude-pattern>lib/Doctrine/DBAL/Platforms/AbstractPlatform.php</exclude-pattern>
        <exclude-pattern>lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php</exclude-pattern>
43
        <exclude-pattern>tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php</exclude-pattern>
44 45 46 47 48 49 50 51 52 53 54 55
    </rule>

    <!-- some statement classes close cursor using an empty while-loop -->
    <rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedWhile">
        <exclude-pattern>lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php</exclude-pattern>
    </rule>

    <!-- sqlsrv functions are documented in upper case but reflected in lower case -->
    <rule ref="Squiz.PHP.LowercasePHPFunctions.CallUppercase">
        <exclude-pattern>lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php</exclude-pattern>
    </rule>

56 57
    <!-- see https://github.com/squizlabs/PHP_CodeSniffer/issues/2165 -->
    <rule ref="Squiz.Arrays.ArrayDeclaration.SpaceBeforeComma">
58
        <exclude-pattern>tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php</exclude-pattern>
59 60
        <exclude-pattern>tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php</exclude-pattern>
    </rule>
61 62

    <!-- see https://github.com/doctrine/dbal/issues/3377 -->
63
    <rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators.DisallowedNotEqualOperator">
64 65
        <exclude-pattern>lib/Doctrine/DBAL/Schema/Comparator.php</exclude-pattern>
    </rule>
66 67 68 69 70

    <!-- see https://github.com/slevomat/coding-standard/issues/737 -->
    <rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.IncorrectReturnTypeHint">
        <exclude-pattern>lib/Doctrine/DBAL/Types/ArrayType.php</exclude-pattern>
        <exclude-pattern>lib/Doctrine/DBAL/Types/ObjectType.php</exclude-pattern>
71
        <exclude-pattern>tests/Doctrine/Tests/DBAL/Driver/Mysqli/MysqliConnectionTest.php</exclude-pattern>
72
    </rule>
Michael Moravec's avatar
Michael Moravec committed
73 74 75 76 77 78

    <!-- DB2_AUTOCOMMIT_ON/DB2_AUTOCOMMIT_OFF are of int type but db2_autocommit() incorrectly expects bool,
         see https://bugs.php.net/bug.php?id=77591 -->
    <rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing">
        <exclude-pattern>lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php</exclude-pattern>
    </rule>
79 80 81 82 83 84

    <!-- The SQLSRV_* functions are defined in the upper case by the sqlsrv extension and violate the standard
         see https://docs.microsoft.com/en-us/sql/connect/php/constants-microsoft-drivers-for-php-for-sql-server -->
    <rule ref="Squiz.PHP.LowercasePHPFunctions.UseStatementUppercase">
        <exclude-pattern>lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php</exclude-pattern>
    </rule>
Luís Cobucci's avatar
Luís Cobucci committed
85
</ruleset>