.php_cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 = Symfony\CS\Finder::create()
  9. ->files()
  10. ->name('*.php')
  11. ->exclude('Fixtures')
  12. // The next 4 files are here for forward compatibility, and are not used by
  13. // Monolog itself
  14. ->exclude(__DIR__.'src/Monolog/Handler/FormattableHandlerInterface.php')
  15. ->exclude(__DIR__.'src/Monolog/Handler/FormattableHandlerTrait.php')
  16. ->exclude(__DIR__.'src/Monolog/Handler/ProcessableHandlerInterface.php')
  17. ->exclude(__DIR__.'src/Monolog/Handler/ProcessableHandlerTrait.php')
  18. ->in(__DIR__.'/src')
  19. ->in(__DIR__.'/tests')
  20. ;
  21. return Symfony\CS\Config::create()
  22. ->setUsingCache(true)
  23. //->setUsingLinter(false)
  24. ->setRiskyAllowed(true)
  25. ->setRules(array(
  26. '@PSR2' => true,
  27. 'binary_operator_spaces' => true,
  28. 'blank_line_before_return' => true,
  29. 'header_comment' => array('header' => $header),
  30. 'include' => true,
  31. 'long_array_syntax' => true,
  32. 'method_separation' => true,
  33. 'no_blank_lines_after_class_opening' => true,
  34. 'no_blank_lines_after_phpdoc' => true,
  35. 'no_blank_lines_between_uses' => true,
  36. 'no_duplicate_semicolons' => true,
  37. 'no_extra_consecutive_blank_lines' => true,
  38. 'no_leading_import_slash' => true,
  39. 'no_leading_namespace_whitespace' => true,
  40. 'no_trailing_comma_in_singleline_array' => true,
  41. 'no_unused_imports' => true,
  42. 'object_operator_without_whitespace' => true,
  43. 'phpdoc_align' => true,
  44. 'phpdoc_indent' => true,
  45. 'phpdoc_no_access' => true,
  46. 'phpdoc_no_package' => true,
  47. 'phpdoc_order' => true,
  48. 'phpdoc_scalar' => true,
  49. 'phpdoc_trim' => true,
  50. 'phpdoc_type_to_var' => true,
  51. 'psr0' => true,
  52. 'single_blank_line_before_namespace' => true,
  53. 'spaces_cast' => true,
  54. 'standardize_not_equals' => true,
  55. 'ternary_operator_spaces' => true,
  56. 'trailing_comma_in_multiline_array' => true,
  57. 'whitespacy_lines' => true,
  58. ))
  59. ->finder($finder)
  60. ;