.php_cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. $header = <<<EOF
  3. This file is part of Composer.
  4. (c) Nils Adermann <naderman@naderman.de>
  5. Jordi Boggiano <j.boggiano@seld.be>
  6. For the full copyright and license information, please view the LICENSE
  7. file that was distributed with this source code.
  8. EOF;
  9. $finder = Symfony\CS\Finder\DefaultFinder::create()
  10. ->files()
  11. ->name('*.php')
  12. ->exclude('Fixtures')
  13. ->in(__DIR__.'/src')
  14. ->in(__DIR__.'/tests')
  15. ;
  16. return Symfony\CS\Config\Config::create()
  17. ->setUsingCache(true)
  18. ->setRiskyAllowed(true)
  19. ->setRules(array(
  20. '@PSR2' => true,
  21. 'duplicate_semicolon' => true,
  22. 'extra_empty_lines' => true,
  23. 'header_comment' => array('header' => $header),
  24. 'include' => true,
  25. 'long_array_syntax' => true,
  26. 'method_separation' => true,
  27. 'multiline_array_trailing_comma' => true,
  28. 'namespace_no_leading_whitespace' => true,
  29. 'no_blank_lines_after_class_opening' => true,
  30. 'no_empty_lines_after_phpdocs' => true,
  31. 'object_operator' => true,
  32. 'operators_spaces' => true,
  33. 'phpdoc_align' => true,
  34. 'phpdoc_indent' => true,
  35. 'phpdoc_no_access' => true,
  36. 'phpdoc_no_package' => true,
  37. 'phpdoc_order' => true,
  38. 'phpdoc_scalar' => true,
  39. 'phpdoc_trim' => true,
  40. 'phpdoc_type_to_var' => true,
  41. 'psr0' => true,
  42. 'return' => true,
  43. 'remove_leading_slash_use' => true,
  44. 'remove_lines_between_uses' => true,
  45. 'single_array_no_trailing_comma' => true,
  46. 'single_blank_line_before_namespace' => true,
  47. 'spaces_cast' => true,
  48. 'standardize_not_equal' => true,
  49. 'ternary_spaces' => true,
  50. 'unused_use' => true,
  51. 'whitespacy_lines' => true,
  52. ))
  53. ->finder($finder)
  54. ;