.php-cs-fixer.dist.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. use PhpCsFixer\Config;
  3. use PhpCsFixer\Finder;
  4. $finder = (new Finder())
  5. ->in(__DIR__)
  6. ;
  7. return (new Config())
  8. ->setRules([
  9. '@PhpCsFixer' => true,
  10. '@PHP8x0Migration' => true,
  11. 'binary_operator_spaces' => [
  12. 'default' => 'align_single_space_minimal',
  13. 'operators' => [
  14. '=>' => 'align_single_space_minimal_by_scope',
  15. ],
  16. ],
  17. 'blank_line_before_statement' => [
  18. 'statements' => [
  19. 'continue',
  20. 'declare',
  21. 'return',
  22. 'throw',
  23. 'try',
  24. ],
  25. ],
  26. 'concat_space' => [
  27. 'spacing' => 'one',
  28. ],
  29. 'global_namespace_import' => [
  30. 'import_classes' => true,
  31. 'import_constants' => false,
  32. 'import_functions' => false,
  33. ],
  34. 'ordered_class_elements' => [
  35. 'order' => [
  36. 'use_trait',
  37. 'case',
  38. 'constant',
  39. 'property',
  40. 'construct',
  41. ],
  42. ],
  43. ])
  44. ->setFinder($finder)
  45. ;