.php_cs.dist 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /*
  3. * This file is part of the Humbug package.
  4. *
  5. * (c) 2015 Pádraic Brady <padraic.brady@gmail.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. use PhpCsFixer\Config;
  11. use PhpCsFixer\Finder;
  12. $finder = Finder::create()
  13. ->in([
  14. __DIR__.'/src',
  15. __DIR__.'/tests',
  16. ])
  17. ->append([
  18. __DIR__.'/.php_cs.dist',
  19. ])
  20. ->exclude([
  21. __DIR__.'/fixtures/Parser/files/php',
  22. ])
  23. ;
  24. return Config::create()
  25. ->setRiskyAllowed(true)
  26. ->setRules([
  27. '@PSR2' => true,
  28. 'blank_line_after_opening_tag' => true,
  29. 'blank_line_before_return' => true,
  30. 'cast_spaces' => true,
  31. 'combine_consecutive_unsets' => true,
  32. 'declare_equal_normalize' => true,
  33. 'declare_strict_types' => false,
  34. 'heredoc_to_nowdoc' => true,
  35. 'include' => true,
  36. 'header_comment' => [
  37. 'location' => 'after_open',
  38. 'header' => <<<'LICENSE'
  39. This file is part of the Humbug package.
  40. (c) 2015 Pádraic Brady <padraic.brady@gmail.com>
  41. For the full copyright and license information, please view the LICENSE
  42. file that was distributed with this source code.
  43. LICENSE
  44. ],
  45. 'lowercase_cast' => true,
  46. 'method_separation' => true,
  47. 'modernize_types_casting' => true,
  48. 'native_function_casing' => true,
  49. 'new_with_braces' => true,
  50. 'no_blank_lines_after_class_opening' => true,
  51. 'no_blank_lines_after_phpdoc' => true,
  52. 'no_empty_comment' => true,
  53. 'no_empty_phpdoc' => true,
  54. 'no_empty_statement' => true,
  55. 'no_leading_import_slash' => true,
  56. 'no_leading_namespace_whitespace' => true,
  57. 'no_multiline_whitespace_around_double_arrow' => true,
  58. 'no_short_bool_cast' => true,
  59. 'no_spaces_around_offset' => true,
  60. 'no_unused_imports' => true,
  61. 'ordered_imports' => true,
  62. 'phpdoc_order' => true,
  63. 'phpdoc_scalar' => true,
  64. 'phpdoc_separation' => true,
  65. 'phpdoc_trim' => true,
  66. 'php_unit_fqcn_annotation' => true,
  67. 'php_unit_test_class_requires_covers' => true,
  68. 'single_quote' => true,
  69. 'space_after_semicolon' => true,
  70. 'standardize_not_equals' => true,
  71. 'trim_array_spaces' => true,
  72. 'whitespace_after_comma_in_array' => true,
  73. ])
  74. ->setFinder($finder)
  75. ;