.php_cs 1.9 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 = PhpCsFixer\Finder::create()
  10. ->files()
  11. ->in(__DIR__.'/src')
  12. ->in(__DIR__.'/tests')
  13. ->name('*.php')
  14. ->notPath('Fixtures')
  15. ;
  16. return PhpCsFixer\Config::create()
  17. ->setUsingCache(true)
  18. ->setRiskyAllowed(true)
  19. ->setRules(array(
  20. '@PSR2' => true,
  21. 'array_syntax' => array('syntax' => 'long'),
  22. 'binary_operator_spaces' => true,
  23. 'blank_line_before_statement' => array('statements' => array('declare', 'return')),
  24. 'cast_spaces' => array('space' => 'single'),
  25. 'header_comment' => array('header' => $header),
  26. 'include' => true,
  27. 'class_attributes_separation' => array('elements' => array('method')),
  28. 'no_blank_lines_after_class_opening' => true,
  29. 'no_blank_lines_after_phpdoc' => true,
  30. 'no_empty_statement' => true,
  31. 'no_extra_consecutive_blank_lines' => true,
  32. 'no_leading_import_slash' => true,
  33. 'no_leading_namespace_whitespace' => true,
  34. 'no_trailing_comma_in_singleline_array' => true,
  35. 'no_unused_imports' => true,
  36. 'no_whitespace_in_blank_line' => true,
  37. 'object_operator_without_whitespace' => true,
  38. 'phpdoc_align' => true,
  39. 'phpdoc_indent' => true,
  40. 'phpdoc_no_access' => true,
  41. 'phpdoc_no_package' => true,
  42. 'phpdoc_order' => true,
  43. 'phpdoc_scalar' => true,
  44. 'phpdoc_trim' => true,
  45. 'phpdoc_types' => true,
  46. 'psr0' => true,
  47. 'single_blank_line_before_namespace' => true,
  48. 'standardize_not_equals' => true,
  49. 'ternary_operator_spaces' => true,
  50. 'trailing_comma_in_multiline_array' => true,
  51. 'unary_operator_spaces' => true,
  52. ))
  53. ->setFinder($finder)
  54. ;