.php_cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. 'align_double_arrow' => null,
  23. 'align_equals' => null,
  24. ),
  25. 'blank_line_before_return' => true,
  26. 'cast_spaces' => true,
  27. 'header_comment' => array('header' => $header),
  28. 'include' => true,
  29. 'method_separation' => true,
  30. 'no_blank_lines_after_class_opening' => true,
  31. 'no_blank_lines_after_phpdoc' => true,
  32. 'no_empty_statement' => true,
  33. 'no_extra_consecutive_blank_lines' => true,
  34. 'no_leading_import_slash' => true,
  35. 'no_leading_namespace_whitespace' => true,
  36. 'no_trailing_comma_in_singleline_array' => true,
  37. 'no_unused_imports' => true,
  38. 'no_whitespace_in_blank_line' => true,
  39. 'object_operator_without_whitespace' => true,
  40. 'phpdoc_align' => true,
  41. 'phpdoc_indent' => true,
  42. 'phpdoc_no_access' => true,
  43. 'phpdoc_no_package' => true,
  44. 'phpdoc_order' => true,
  45. //'phpdoc_scalar' => true,
  46. 'phpdoc_trim' => true,
  47. //'phpdoc_types' => true,
  48. 'psr0' => true,
  49. //'array_syntax' => array('syntax' => 'short'),
  50. 'declare_strict_types' => true,
  51. 'single_blank_line_before_namespace' => true,
  52. 'standardize_not_equals' => true,
  53. 'ternary_operator_spaces' => true,
  54. 'trailing_comma_in_multiline_array' => true,
  55. ))
  56. ->setFinder($finder)
  57. ;