.php_cs.dist 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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(array(
  12. '@Symfony' => true,
  13. '@Symfony:risky' => true,
  14. 'array_syntax' => array('syntax' => 'long'),
  15. 'combine_consecutive_unsets' => true,
  16. // one should use PHPUnit methods to set up expected exception instead of annotations
  17. 'general_phpdoc_annotation_remove' => array('expectedException', 'expectedExceptionMessage', 'expectedExceptionMessageRegExp'),
  18. 'header_comment' => array('header' => $header),
  19. 'heredoc_to_nowdoc' => true,
  20. 'no_extra_consecutive_blank_lines' => array('break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block'),
  21. 'no_unreachable_default_argument_value' => true,
  22. 'no_useless_else' => true,
  23. 'no_useless_return' => true,
  24. 'ordered_class_elements' => true,
  25. 'ordered_imports' => true,
  26. 'php_unit_strict' => true,
  27. 'phpdoc_add_missing_param_annotation' => true,
  28. 'phpdoc_order' => true,
  29. 'psr4' => true,
  30. 'strict_comparison' => true,
  31. 'strict_param' => true,
  32. ))
  33. ->setFinder(
  34. PhpCsFixer\Finder::create()
  35. ->exclude('tests/Fixtures')
  36. ->in(__DIR__)
  37. )
  38. ;