.php_cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. $header = <<<EOF
  3. This file is part of the Monolog package.
  4. (c) Jordi Boggiano <j.boggiano@seld.be>
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. EOF;
  8. $finder = PhpCsFixer\Finder::create()
  9. ->files()
  10. ->name('*.php')
  11. ->exclude('Fixtures')
  12. ->in(__DIR__.'/src')
  13. ->in(__DIR__.'/tests')
  14. ;
  15. return PhpCsFixer\Config::create()
  16. ->setUsingCache(true)
  17. ->setRiskyAllowed(true)
  18. ->setRules(array(
  19. '@PSR2' => true,
  20. // some rules disabled as long as 1.x branch is maintained
  21. 'binary_operator_spaces' => array(
  22. 'default' => null,
  23. ),
  24. 'blank_line_before_statement' => ['statements' => ['continue', 'declare', 'return', 'throw', 'try']],
  25. 'cast_spaces' => ['space' => 'single'],
  26. 'header_comment' => ['header' => $header],
  27. 'include' => true,
  28. 'class_attributes_separation' => ['elements' => ['method']],
  29. 'no_blank_lines_after_class_opening' => true,
  30. 'no_blank_lines_after_phpdoc' => true,
  31. 'no_empty_statement' => true,
  32. 'no_extra_consecutive_blank_lines' => true,
  33. 'no_leading_import_slash' => true,
  34. 'no_leading_namespace_whitespace' => true,
  35. 'no_trailing_comma_in_singleline_array' => true,
  36. 'no_unused_imports' => true,
  37. 'no_whitespace_in_blank_line' => true,
  38. 'object_operator_without_whitespace' => true,
  39. 'phpdoc_align' => true,
  40. 'phpdoc_indent' => true,
  41. 'phpdoc_no_access' => true,
  42. 'phpdoc_no_package' => true,
  43. 'phpdoc_order' => true,
  44. //'phpdoc_scalar' => true,
  45. 'phpdoc_trim' => true,
  46. //'phpdoc_types' => true,
  47. 'psr0' => true,
  48. //'array_syntax' => array('syntax' => 'short'),
  49. 'declare_strict_types' => true,
  50. 'single_blank_line_before_namespace' => true,
  51. 'standardize_not_equals' => true,
  52. 'ternary_operator_spaces' => true,
  53. 'trailing_comma_in_multiline_array' => true,
  54. ))
  55. ->setFinder($finder)
  56. ;