.php_cs.dist 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. $header = <<<'EOF'
  3. This file is part of sebastian/comparator.
  4. (c) Sebastian Bergmann <sebastian@phpunit.de>
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. EOF;
  8. return PhpCsFixer\Config::create()
  9. ->setRiskyAllowed(true)
  10. ->setRules(
  11. [
  12. 'array_syntax' => ['syntax' => 'short'],
  13. 'binary_operator_spaces' => [
  14. 'align_double_arrow' => true,
  15. 'align_equals' => true
  16. ],
  17. 'blank_line_after_namespace' => true,
  18. 'blank_line_before_statement' => [
  19. 'statements' => [
  20. 'break',
  21. 'continue',
  22. 'return',
  23. 'throw',
  24. 'try',
  25. ],
  26. ],
  27. 'braces' => true,
  28. 'cast_spaces' => true,
  29. 'concat_space' => ['spacing' => 'one'],
  30. 'elseif' => true,
  31. 'encoding' => true,
  32. 'full_opening_tag' => true,
  33. 'function_declaration' => true,
  34. 'header_comment' => ['header' => $header, 'separate' => 'none'],
  35. 'indentation_type' => true,
  36. 'line_ending' => true,
  37. 'lowercase_constants' => true,
  38. 'lowercase_keywords' => true,
  39. 'method_argument_space' => true,
  40. 'native_function_invocation' => true,
  41. 'no_alias_functions' => true,
  42. 'no_blank_lines_after_class_opening' => true,
  43. 'no_blank_lines_after_phpdoc' => true,
  44. 'no_closing_tag' => true,
  45. 'no_empty_phpdoc' => true,
  46. 'no_empty_statement' => true,
  47. 'no_extra_consecutive_blank_lines' => true,
  48. 'no_leading_namespace_whitespace' => true,
  49. 'no_singleline_whitespace_before_semicolons' => true,
  50. 'no_spaces_after_function_name' => true,
  51. 'no_spaces_inside_parenthesis' => true,
  52. 'no_trailing_comma_in_list_call' => true,
  53. 'no_trailing_whitespace' => true,
  54. 'no_unused_imports' => true,
  55. 'no_whitespace_in_blank_line' => true,
  56. 'ordered_imports' => true,
  57. 'phpdoc_align' => true,
  58. 'phpdoc_indent' => true,
  59. 'phpdoc_no_access' => true,
  60. 'phpdoc_no_empty_return' => true,
  61. 'phpdoc_no_package' => true,
  62. 'phpdoc_scalar' => true,
  63. 'phpdoc_separation' => true,
  64. 'phpdoc_to_comment' => true,
  65. 'phpdoc_trim' => true,
  66. 'phpdoc_types' => true,
  67. 'phpdoc_var_without_name' => true,
  68. 'self_accessor' => true,
  69. 'simplified_null_return' => true,
  70. 'single_blank_line_at_eof' => true,
  71. 'single_import_per_statement' => true,
  72. 'single_line_after_imports' => true,
  73. 'single_quote' => true,
  74. 'ternary_operator_spaces' => true,
  75. 'trim_array_spaces' => true,
  76. 'visibility_required' => true,
  77. ]
  78. )
  79. ->setFinder(
  80. PhpCsFixer\Finder::create()
  81. ->files()
  82. ->in(__DIR__ . '/src')
  83. ->in(__DIR__ . '/tests')
  84. ->name('*.php')
  85. );