phpcs.xml.dist 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?xml version="1.0"?>
  2. <ruleset
  3. name="PHPMatrix"
  4. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  5. xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd"
  6. >
  7. <description>The code standard for PHPMatrix is PSR2.</description>
  8. <!-- ##### Coding Standard check #####-->
  9. <rule ref="PSR2"/>
  10. <!--
  11. #############################################################################
  12. COMMAND LINE ARGUMENTS
  13. https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
  14. #############################################################################
  15. -->
  16. <!-- Check all files in this directory and the directories below it. -->
  17. <file>.</file>
  18. <!-- Do not check the vendor directory. -->
  19. <exclude-pattern>/vendor/*</exclude-pattern>
  20. <!-- Show progress & sniff codes. -->
  21. <arg value="ps"/>
  22. <!-- Only check PHP files. -->
  23. <arg name="extensions" value="php"/>
  24. <!-- Strip the filepaths down to the relevant bit. -->
  25. <arg name="basepath" value="."/>
  26. <!-- Check up to 8 files simultanously. -->
  27. <arg name="parallel" value="8"/>
  28. <!--
  29. #############################################################################
  30. RULESETS
  31. #############################################################################
  32. -->
  33. <!-- ##### Check PHP cross-version compatibility ##### -->
  34. <rule ref="PHPCompatibility" />
  35. <config name="testVersion" value="7.2"/>
  36. <!--
  37. #############################################################################
  38. CUSTOMIZATIONS
  39. #############################################################################
  40. -->
  41. <!-- Warn about lines longer than 132 chars, and error for lines longer than 155 chars. -->
  42. <rule ref="Generic.Files.LineLength">
  43. <properties>
  44. <property name="lineLimit" value="132" />
  45. <property name="absoluteLineLimit" value="155" />
  46. </properties>
  47. </rule>
  48. <!--
  49. #############################################################################
  50. SELECTIVE EXCEPTIONS
  51. #############################################################################
  52. -->
  53. <rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
  54. <!-- Don't break BC for integrations by renaming the autoloader methods. Not worth it. -->
  55. <exclude-pattern>/classes/Autoloader\.php$</exclude-pattern>
  56. </rule>
  57. <rule ref="PSR1.Classes.ClassDeclaration">
  58. <!-- Don't break BC for integrations by renaming the autoloader methods. Not worth it. -->
  59. <exclude-pattern>/classes/Bootstrap\.php$</exclude-pattern>
  60. </rule>
  61. <rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
  62. <!-- Exempt the bootstrap files from the side-effects rule. -->
  63. <exclude-pattern>/classes/Bootstrap\.php$</exclude-pattern>
  64. <exclude-pattern>/unitTests/bootstrap\.php$</exclude-pattern>
  65. </rule>
  66. <rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
  67. <exclude-pattern>/unitTests/classes/src/functions/*Test\.php$</exclude-pattern>
  68. <exclude-pattern>/unitTests/classes/src/operations/*Test\.php$</exclude-pattern>
  69. </rule>
  70. </ruleset>