.php_cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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\DefaultFinder::create()
  9. ->files()
  10. ->name('*.php')
  11. ->exclude('Fixtures')
  12. ->in(__DIR__.'/src')
  13. ->in(__DIR__.'/tests')
  14. ;
  15. return Symfony\CS\Config\Config::create()
  16. ->setUsingCache(true)
  17. ->setRiskyAllowed(true)
  18. ->setRules(array(
  19. '@PSR2' => true,
  20. 'duplicate_semicolon' => true,
  21. 'extra_empty_lines' => true,
  22. 'header_comment' => array('header' => $header),
  23. 'include' => true,
  24. 'long_array_syntax' => true,
  25. 'method_separation' => true,
  26. 'multiline_array_trailing_comma' => true,
  27. 'namespace_no_leading_whitespace' => true,
  28. 'no_blank_lines_after_class_opening' => true,
  29. 'no_empty_lines_after_phpdocs' => true,
  30. 'object_operator' => true,
  31. 'operators_spaces' => true,
  32. 'phpdoc_align' => true,
  33. 'phpdoc_indent' => true,
  34. 'phpdoc_no_access' => true,
  35. 'phpdoc_no_package' => true,
  36. 'phpdoc_order' => true,
  37. 'phpdoc_scalar' => true,
  38. 'phpdoc_trim' => true,
  39. 'phpdoc_type_to_var' => true,
  40. 'psr0' => true,
  41. 'return' => true,
  42. 'remove_leading_slash_use' => true,
  43. 'remove_lines_between_uses' => true,
  44. 'single_array_no_trailing_comma' => true,
  45. 'single_blank_line_before_namespace' => true,
  46. 'spaces_cast' => true,
  47. 'standardize_not_equal' => true,
  48. 'ternary_spaces' => true,
  49. 'unused_use' => true,
  50. 'whitespacy_lines' => true,
  51. ))
  52. ->finder($finder)
  53. ;