.php_cs.dist 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * PHP Coding Standards fixer configuration
  8. */
  9. $finder = PhpCsFixer\Finder::create()
  10. ->name('*.phtml')
  11. ->exclude('dev/tests/functional/generated')
  12. ->exclude('dev/tests/functional/var')
  13. ->exclude('dev/tests/functional/vendor')
  14. ->exclude('dev/tests/integration/tmp')
  15. ->exclude('dev/tests/integration/var')
  16. ->exclude('lib/internal/Cm')
  17. ->exclude('lib/internal/Credis')
  18. ->exclude('lib/internal/Less')
  19. ->exclude('lib/internal/LinLibertineFont')
  20. ->exclude('pub/media')
  21. ->exclude('pub/static')
  22. ->exclude('setup/vendor')
  23. ->exclude('var');
  24. return PhpCsFixer\Config::create()
  25. ->setFinder($finder)
  26. ->setRules([
  27. '@PSR2' => true,
  28. 'array_syntax' => ['syntax' => 'short'],
  29. 'concat_space' => ['spacing' => 'one'],
  30. 'include' => true,
  31. 'new_with_braces' => true,
  32. 'no_empty_statement' => true,
  33. 'no_extra_consecutive_blank_lines' => true,
  34. 'no_leading_import_slash' => true,
  35. 'no_leading_namespace_whitespace' => true,
  36. 'no_multiline_whitespace_around_double_arrow' => true,
  37. 'no_multiline_whitespace_before_semicolons' => true,
  38. 'no_singleline_whitespace_before_semicolons' => true,
  39. 'no_trailing_comma_in_singleline_array' => true,
  40. 'no_unused_imports' => true,
  41. 'no_whitespace_in_blank_line' => true,
  42. 'object_operator_without_whitespace' => true,
  43. 'ordered_imports' => true,
  44. 'standardize_not_equals' => true,
  45. 'ternary_operator_spaces' => true,
  46. ]);