.php_cs.dist 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. $header = <<<'EOF'
  3. This file is part of PHP CS Fixer.
  4. (c) Fabien Potencier <fabien@symfony.com>
  5. Dariusz Rumiński <dariusz.ruminski@gmail.com>
  6. This source file is subject to the MIT license that is bundled
  7. with this source code in the file LICENSE.
  8. EOF;
  9. return PhpCsFixer\Config::create()
  10. ->setRiskyAllowed(true)
  11. ->setRules([
  12. '@PHP56Migration' => true,
  13. '@Symfony' => true,
  14. '@Symfony:risky' => true,
  15. 'array_syntax' => ['syntax' => 'short'],
  16. 'combine_consecutive_unsets' => true,
  17. // one should use PHPUnit methods to set up expected exception instead of annotations
  18. 'general_phpdoc_annotation_remove' => ['expectedException', 'expectedExceptionMessage', 'expectedExceptionMessageRegExp'],
  19. 'header_comment' => ['header' => $header],
  20. 'heredoc_to_nowdoc' => true,
  21. 'list_syntax' => ['syntax' => 'long'],
  22. 'no_extra_consecutive_blank_lines' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block'],
  23. 'no_short_echo_tag' => true,
  24. 'no_unreachable_default_argument_value' => true,
  25. 'no_useless_else' => true,
  26. 'no_useless_return' => true,
  27. 'ordered_class_elements' => true,
  28. 'ordered_imports' => true,
  29. 'php_unit_strict' => true,
  30. 'php_unit_test_class_requires_covers' => true,
  31. 'phpdoc_add_missing_param_annotation' => true,
  32. 'phpdoc_order' => true,
  33. 'semicolon_after_instruction' => true,
  34. 'strict_comparison' => true,
  35. 'strict_param' => true,
  36. ])
  37. ->setFinder(
  38. PhpCsFixer\Finder::create()
  39. ->exclude('tests/Fixtures')
  40. ->in(__DIR__)
  41. )
  42. ;