.php_cs.dist 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. $header = '/* For licensing terms, see /license.txt */';
  3. $rules = [
  4. '@Symfony' => true,
  5. //'@Symfony:risky' => true,
  6. 'array_syntax' => [
  7. 'syntax' => 'short',
  8. ],
  9. /*'header_comment' => [
  10. 'header' => $header,
  11. ],*/
  12. 'blank_line_after_opening_tag' => false,
  13. 'no_extra_consecutive_blank_lines' => true,
  14. 'multiline_comment_opening_closing' => true,
  15. 'yoda_style' => false,
  16. 'phpdoc_to_comment' => false,
  17. 'phpdoc_no_package' => false,
  18. 'phpdoc_annotation_without_dot' => false,
  19. 'increment_style' => ['style' => 'post'],
  20. 'no_useless_else' => false,
  21. //'no_php4_constructor' => true,
  22. 'single_quote' => false,
  23. 'no_useless_return' => true,
  24. 'ordered_class_elements' => true,
  25. 'ordered_imports' => true,
  26. 'phpdoc_order' => true,
  27. 'no_break_comment' => true,
  28. //'@PHP56Migration' => true,
  29. //'@PHP56Migration:risky' => true,
  30. //'@PHPUnit57Migration:risky' => true,
  31. // To be tested before insertion:
  32. // 'strict_comparison' => true,
  33. // 'strict_param' => true,
  34. // 'php_unit_strict' => true,
  35. ];
  36. $finder = PhpCsFixer\Finder::create()
  37. ->exclude('app/')
  38. ->exclude('assets')
  39. ->exclude('bin')
  40. ->exclude('documentation')
  41. ->exclude('main/auth/cas/lib')
  42. ->exclude('main/auth/shibboleth')
  43. ->exclude('main/auth/openid')
  44. ->exclude('main/fonts')
  45. ->exclude('main/inc/lib/browser')
  46. ->exclude('main/inc/lib/internationalization_database')
  47. ->exclude('main/inc/lib/javascript')
  48. ->exclude('main/inc/lib/kses-0.2.2')
  49. ->exclude('main/inc/lib/mimetex')
  50. ->exclude('main/inc/lib/nanogong')
  51. ->exclude('main/inc/lib/nusoap')
  52. ->exclude('main/inc/lib/opengraph')
  53. ->exclude('main/inc/lib/ppt2png')
  54. ->exclude('main/inc/lib/phpseclib')
  55. ->exclude('main/inc/lib/pear')
  56. ->exclude('main/inc/lib/phpseclib')
  57. ->exclude('main/inc/lib/svg-edit')
  58. ->exclude('main/inc/lib/swfobject')
  59. ->exclude('main/inc/lib/wami-recorder')
  60. ->exclude('main/inc/lib/xajax')
  61. ->exclude('main/lp/packaging')
  62. ->exclude('main/template')
  63. ->exclude('main/img')
  64. ->exclude('main/lang')
  65. ->exclude('plugin/buycourses/src/Culqi')
  66. ->exclude('plugin/buycourses/src/Requests')
  67. ->exclude('plugin/vchamilo/cli')
  68. ->exclude('plugin/pens/lib')
  69. ->exclude('plugin/bbb/lib')
  70. ->exclude('plugin/ims_lti')
  71. ->exclude('plugin/sepe/src/wsse')
  72. ->exclude('plugin/test2pdf/class')
  73. ->exclude('plugin/jcapture/src')
  74. ->exclude('plugin/jcapture/lib')
  75. ->exclude('tests')
  76. ->exclude('var')
  77. ->exclude('vendor')
  78. ->exclude('web')
  79. ->notPath('main/admin/db.php')
  80. ->notPath('public/check.php')
  81. ->notPath('main/admin/ldap_synchro.php')
  82. ->notPath('main/chat/emoji_strategy.php')
  83. ->in(__DIR__)
  84. ;
  85. return PhpCsFixer\Config::create()
  86. ->setRules(
  87. $rules
  88. )
  89. ->setFinder($finder);