phpcs.xml 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <ruleset name="RSS-Bridge Ruleset">
  3. <description>Created with the PHP Coding Standard Generator. http://edorian.github.com/php-coding-standard-generator/</description>
  4. <exclude-pattern>./static</exclude-pattern>
  5. <exclude-pattern>./vendor</exclude-pattern>
  6. <!-- Duplicate class names are not allowed -->
  7. <rule ref="Generic.Classes.DuplicateClassName"/>
  8. <!-- Statements must not be empty -->
  9. <rule ref="Generic.CodeAnalysis.EmptyStatement"/>
  10. <!-- Unconditional if-statements are not allowed -->
  11. <rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
  12. <!-- Do not use final statements inside final classes -->
  13. <rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
  14. <!-- Do not override methods to call their parent -->
  15. <rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
  16. <!-- One line should not have more than 80 characters -->
  17. <!-- One line must never exceed 120 characters -->
  18. <rule ref="Generic.Files.LineLength">
  19. <properties>
  20. <property name="lineLimit" value="80"/>
  21. <property name="absoluteLineLimit" value="120"/>
  22. </properties>
  23. </rule>
  24. <!-- When calling a function: -->
  25. <!-- Do not add a space before the opening parenthesis -->
  26. <!-- Do not add a space after the opening parenthesis -->
  27. <!-- Do not add a space before the closing parenthesis -->
  28. <!-- Do not add a space before a comma -->
  29. <!-- Add a space after a comma -->
  30. <rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
  31. <!-- Use UPPERCARE for constants -->
  32. <rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
  33. <!-- Use lowercase for 'true', 'false' and 'null' -->
  34. <rule ref="Generic.PHP.LowerCaseConstant"/>
  35. <!-- Use a single string instead of concating -->
  36. <rule ref="Generic.Strings.UnnecessaryStringConcat"/>
  37. <!-- Use tabs for indentation -->
  38. <rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
  39. <!-- Parameters with default values must appear last in functions -->
  40. <rule ref="PEAR.Functions.ValidDefaultValue"/>
  41. <!-- Use PascalCase for class names -->
  42. <rule ref="PEAR.NamingConventions.ValidClassName"/>
  43. <!-- Use 'elseif' instead of 'else if' -->
  44. <rule ref="PSR2.ControlStructures.ElseIfDeclaration"/>
  45. <!-- Do not add spaces after opening or before closing bracket -->
  46. <rule ref="PSR2.ControlStructures.ControlStructureSpacing"/>
  47. <!-- Add a new line at the end of a file -->
  48. <rule ref="PSR2.Files.EndFileNewline"/>
  49. <!-- Add space after closing parenthesis -->
  50. <!-- Add body into new line -->
  51. <!-- Close body in new line -->
  52. <rule ref="Squiz.ControlStructures.ControlSignature">
  53. <!-- No space after keyword (before opening parenthesis) -->
  54. <exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/>
  55. </rule>
  56. <!-- When declaring a function: -->
  57. <!-- Do not add a space before a comma -->
  58. <!-- Add a space after a comma -->
  59. <!-- Add a space before and after an equal sign -->
  60. <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
  61. <properties>
  62. <property name="equalsSpacing" value="1"/>
  63. </properties>
  64. </rule>
  65. <!-- Do not add spaces when casting -->
  66. <rule ref="Squiz.WhiteSpace.CastSpacing"/>
  67. <!-- Operators must have a space around them -->
  68. <rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
  69. <!-- Do not add a whitespace before a semicolon -->
  70. <rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
  71. <!-- Do not add whitespace at start or end of a file or end of a line -->
  72. <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
  73. <!-- Whenever possible use single quote strings -->
  74. <rule ref="Squiz.Strings.DoubleQuoteUsage">
  75. <exclude name="Squiz.Strings.DoubleQuoteUsage.ContainsVar" />
  76. </rule>
  77. </ruleset>