.php_cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. //->setUsingLinter(false)
  19. ->setRiskyAllowed(true)
  20. ->setRules(array(
  21. '@PSR2' => true,
  22. 'array_syntax' => array('syntax' => 'long'),
  23. 'binary_operator_spaces' => true,
  24. 'blank_line_before_return' => true,
  25. 'cast_spaces' => true,
  26. 'header_comment' => array('header' => $header),
  27. 'include' => true,
  28. 'method_separation' => true,
  29. 'no_blank_lines_after_class_opening' => true,
  30. 'no_blank_lines_after_phpdoc' => true,
  31. 'no_empty_statement' => true,
  32. 'no_extra_consecutive_blank_lines' => true,
  33. 'no_leading_import_slash' => true,
  34. 'no_leading_namespace_whitespace' => true,
  35. 'no_trailing_comma_in_singleline_array' => true,
  36. 'no_unused_imports' => true,
  37. 'no_useless_else' => 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. 'short_scalar_cast' => true,
  50. 'single_blank_line_before_namespace' => true,
  51. 'standardize_not_equals' => true,
  52. 'ternary_operator_spaces' => true,
  53. 'trailing_comma_in_multiline_array' => true,
  54. ))
  55. ->setFinder($finder)
  56. ;