.php_cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. $header = <<<EOF
  3. This file is part of composer/semver.
  4. (c) Composer <https://github.com/composer>
  5. For the full copyright and license information, please view
  6. the LICENSE file that was distributed with this source code.
  7. EOF;
  8. $finder = PhpCsFixer\Finder::create()
  9. ->files()
  10. ->in(__DIR__.'/src')
  11. ->in(__DIR__.'/tests')
  12. ->name('*.php')
  13. ->notPath('Fixtures')
  14. ;
  15. return PhpCsFixer\Config::create()
  16. ->setUsingCache(true)
  17. ->setRiskyAllowed(true)
  18. ->setRules(array(
  19. '@PSR2' => true,
  20. 'array_syntax' => array('syntax' => 'long'),
  21. 'binary_operator_spaces' => true,
  22. 'blank_line_before_statement' => array('statements' => array('declare', 'return')),
  23. 'cast_spaces' => array('space' => 'single'),
  24. 'class_attributes_separation' => array('elements' => array('method')),
  25. 'header_comment' => array('header' => $header),
  26. 'include' => true,
  27. 'no_blank_lines_after_class_opening' => true,
  28. 'no_blank_lines_after_phpdoc' => true,
  29. 'no_empty_statement' => true,
  30. 'no_extra_consecutive_blank_lines' => true,
  31. 'no_leading_import_slash' => true,
  32. 'no_leading_namespace_whitespace' => true,
  33. 'no_trailing_comma_in_singleline_array' => true,
  34. 'no_unused_imports' => true,
  35. 'no_whitespace_in_blank_line' => true,
  36. 'object_operator_without_whitespace' => true,
  37. 'phpdoc_align' => true,
  38. 'phpdoc_indent' => true,
  39. 'phpdoc_no_access' => true,
  40. 'phpdoc_no_package' => true,
  41. 'phpdoc_order' => true,
  42. 'phpdoc_scalar' => true,
  43. 'phpdoc_trim' => true,
  44. 'phpdoc_types' => true,
  45. 'psr0' => true,
  46. 'single_blank_line_before_namespace' => true,
  47. 'standardize_not_equals' => true,
  48. 'ternary_operator_spaces' => true,
  49. 'trailing_comma_in_multiline_array' => true,
  50. ))
  51. ->setFinder($finder)
  52. ;