.phpcs.xml.dist 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?xml version="1.0"?>
  2. <ruleset name="Tighten">
  3. <!--
  4. The name attribute of the ruleset tag is displayed
  5. when running PHP_CodeSniffer with the -v command line
  6. argument. The description tag below is not displayed anywhere
  7. except in this file, so it can contain information for
  8. developers who may change this file in the future.
  9. -->
  10. <description>Tighten's Laravel Coding Standards</description>
  11. <!--
  12. If no files or directories are specified on the command line
  13. your custom standard can specify what files should be checked
  14. instead.
  15. Note that specifying any file or directory path
  16. on the command line will ignore all file tags.
  17. -->
  18. <file>config</file>
  19. <file>src</file>
  20. <file>tests</file>
  21. <!--
  22. You can hard-code ignore patterns directly into your
  23. custom standard so you don't have to specify the
  24. patterns on the command line.
  25. -->
  26. <exclude-pattern>*/cache/*</exclude-pattern>
  27. <exclude-pattern>*/*.js</exclude-pattern>
  28. <exclude-pattern>*/*.css</exclude-pattern>
  29. <exclude-pattern>*/*.xml</exclude-pattern>
  30. <exclude-pattern>*/*.blade.php</exclude-pattern>
  31. <exclude-pattern>*/autoload.php</exclude-pattern>
  32. <exclude-pattern>*/vendor/*</exclude-pattern>
  33. <!--
  34. You can hard-code command line values into your custom standard.
  35. Note that this does not work for the command line values:
  36. -v[v][v], -l, -d, -sniffs and -standard
  37. -->
  38. <arg name="colors"/>
  39. <arg value="p"/>
  40. <!--
  41. You can hard-code custom php.ini settings into your custom standard.
  42. The following tag sets the memory limit to 64M.
  43. -->
  44. <ini name="memory_limit" value="128M"/>
  45. <!--
  46. Include all sniffs in the PSR12 standard. Note that the
  47. path to the standard does not have to be specified as the
  48. PSR12 standard exists inside the PHP_CodeSniffer install
  49. directory.
  50. -->
  51. <rule ref="PSR12"/>
  52. <!-- Disable missing namespace rule for tests and database files -->
  53. <rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
  54. <exclude-pattern>*/tests/*</exclude-pattern>
  55. </rule>
  56. <!-- Disable camel caps rule for tests -->
  57. <rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
  58. <exclude-pattern>*/tests/*</exclude-pattern>
  59. </rule>
  60. <!-- Make the soft line length warning silent -->
  61. <rule ref="Generic.Files.LineLength.TooLong">
  62. <severity>0</severity>
  63. </rule>
  64. <!-- Enable some extra rules -->
  65. <!-- Force [] short array syntax -->
  66. <rule ref="Generic.Arrays.DisallowLongArraySyntax.Found"/>
  67. <!-- Enforce 1 space around concatenation operators -->
  68. <rule ref="Squiz.Strings.ConcatenationSpacing">
  69. <properties>
  70. <property name="spacing" value="1" />
  71. </properties>
  72. </rule>
  73. <!-- Warn when double quotes are used over single quotes -->
  74. <rule ref="Squiz.Strings.DoubleQuoteUsage"/>
  75. <!-- Except when the double quotes contain a variable -->
  76. <rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar">
  77. <severity>0</severity>
  78. </rule>
  79. <!-- Class name should match the file name -->
  80. <rule ref="Squiz.Classes.ClassFileName"/>
  81. <!-- Expect one space after NOT (!) operator -->
  82. <rule ref="Generic.Formatting.SpaceAfterNot"/>
  83. </ruleset>