phpcs.xml.dist 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <ruleset name="Coding Standard">
  3. <description>
  4. This standard requires PHP_CodeSniffer >= 3.4.
  5. </description>
  6. <arg name="colors"/>
  7. <arg name="extensions" value="php"/>
  8. <!--The complete PSR-12 rule set-->
  9. <rule ref="PSR12"/>
  10. <!-- Arrays -->
  11. <rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
  12. <rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
  13. <!-- Classes -->
  14. <rule ref="Generic.Classes.DuplicateClassName"/>
  15. <rule ref="Squiz.Classes.ClassFileName"/>
  16. <rule ref="Squiz.Classes.DuplicateProperty"/>
  17. <rule ref="Squiz.Classes.LowercaseClassKeywords"/>
  18. <rule ref="Squiz.Classes.SelfMemberReference"/>
  19. <!-- Code analysis -->
  20. <rule ref="Generic.CodeAnalysis.AssignmentInCondition"/>
  21. <rule ref="Generic.CodeAnalysis.EmptyStatement"/>
  22. <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
  23. <rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
  24. <rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
  25. <rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
  26. <rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
  27. <rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
  28. <!-- Commenting -->
  29. <rule ref="Generic.Commenting.Fixme"/>
  30. <rule ref="Generic.Commenting.Todo"/>
  31. <rule ref="PEAR.Commenting.InlineComment"/>
  32. <rule ref="Squiz.Commenting.DocCommentAlignment"/>
  33. <rule ref="Squiz.Commenting.EmptyCatchComment"/>
  34. <rule ref="Squiz.Commenting.FunctionCommentThrowTag"/>
  35. <rule ref="Squiz.Commenting.PostStatementComment"/>
  36. <!-- Control structures -->
  37. <rule ref="PEAR.ControlStructures.ControlSignature"/>
  38. <!-- Debug -->
  39. <rule ref="Generic.Debug.ClosureLinter"/>
  40. <!-- Files -->
  41. <rule ref="Generic.Files.OneClassPerFile"/>
  42. <rule ref="Generic.Files.OneInterfacePerFile"/>
  43. <rule ref="Generic.Files.OneObjectStructurePerFile"/>
  44. <rule ref="Zend.Files.ClosingTag"/>
  45. <!-- Formatting -->
  46. <rule ref="PEAR.Formatting.MultiLineAssignment"/>
  47. <!-- Functions -->
  48. <rule ref="Generic.Functions.CallTimePassByReference"/>
  49. <rule ref="PSR12.Functions.NullableTypeDeclaration"/>
  50. <rule ref="Squiz.Functions.FunctionDuplicateArgument"/>
  51. <rule ref="Squiz.Functions.GlobalFunction"/>
  52. <!-- Metrics -->
  53. <rule ref="Generic.Metrics.CyclomaticComplexity"/>
  54. <rule ref="Generic.Metrics.NestingLevel"/>
  55. <!-- Naming conventions -->
  56. <rule ref="Generic.NamingConventions.ConstructorName"/>
  57. <rule ref="PEAR.NamingConventions.ValidClassName"/>
  58. <!-- Objects -->
  59. <rule ref="Squiz.Objects.ObjectMemberComma"/>
  60. <!-- Operators -->
  61. <rule ref="Squiz.Operators.IncrementDecrementUsage"/>
  62. <rule ref="Squiz.Operators.ValidLogicalOperators"/>
  63. <!-- PHP -->
  64. <rule ref="Generic.PHP.BacktickOperator"/>
  65. <rule ref="Generic.PHP.CharacterBeforePHPOpeningTag"/>
  66. <rule ref="Generic.PHP.DeprecatedFunctions"/>
  67. <rule ref="Generic.PHP.DisallowAlternativePHPTags"/>
  68. <rule ref="Generic.PHP.DiscourageGoto"/>
  69. <rule ref="Generic.PHP.ForbiddenFunctions"/>
  70. <rule ref="Generic.PHP.NoSilencedErrors"/>
  71. <rule ref="Squiz.PHP.CommentedOutCode">
  72. <properties>
  73. <property name="maxPercentage" value="70"/>
  74. </properties>
  75. </rule>
  76. <rule ref="Squiz.PHP.DisallowMultipleAssignments"/>
  77. <rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/>
  78. <rule ref="Squiz.PHP.DiscouragedFunctions"/>
  79. <rule ref="Squiz.PHP.Eval"/>
  80. <rule ref="Squiz.PHP.GlobalKeyword"/>
  81. <rule ref="Squiz.PHP.Heredoc"/>
  82. <rule ref="Squiz.PHP.InnerFunctions"/>
  83. <rule ref="Squiz.PHP.LowercasePHPFunctions"/>
  84. <rule ref="Squiz.PHP.NonExecutableCode"/>
  85. <!-- Scope -->
  86. <rule ref="Squiz.Scope.MemberVarScope"/>
  87. <rule ref="Squiz.Scope.StaticThisUsage"/>
  88. <!-- Strings -->
  89. <rule ref="Squiz.Strings.DoubleQuoteUsage"/>
  90. <!-- Whitespace -->
  91. <rule ref="PEAR.WhiteSpace.ObjectOperatorIndent"/>
  92. <rule ref="PEAR.WhiteSpace.ScopeClosingBrace"/>
  93. <rule ref="Squiz.WhiteSpace.CastSpacing"/>
  94. <rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
  95. <rule ref="Squiz.WhiteSpace.OperatorSpacing">
  96. <properties>
  97. <property name="ignoreNewlines" value="true"/>
  98. </properties>
  99. </rule>
  100. <rule ref="Squiz.WhiteSpace.PropertyLabelSpacing"/>
  101. <rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
  102. </ruleset>