.php_cs.dist 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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/default_course_document')
  45. ->exclude('main/fonts')
  46. ->exclude('main/inc/lib/browser')
  47. ->exclude('main/inc/lib/freemindflashbrowser')
  48. ->exclude('main/inc/lib/internationalization_database')
  49. ->exclude('main/inc/lib/javascript')
  50. ->exclude('main/inc/lib/kses-0.2.2')
  51. ->exclude('main/inc/lib/mimetex')
  52. ->exclude('main/inc/lib/nanogong')
  53. ->exclude('main/inc/lib/nusoap')
  54. ->exclude('main/inc/lib/opengraph')
  55. ->exclude('main/inc/lib/ppt2png')
  56. ->exclude('main/inc/lib/phpseclib')
  57. ->exclude('main/inc/lib/pear')
  58. ->exclude('main/inc/lib/svg-edit')
  59. ->exclude('main/inc/lib/swfobject')
  60. ->exclude('main/inc/lib/wami-recorder')
  61. ->exclude('main/inc/lib/xajax')
  62. ->exclude('main/lp/packaging')
  63. ->exclude('main/template')
  64. ->exclude('main/img')
  65. ->exclude('main/lang')
  66. ->exclude('plugin/buycourses/src/Culqi')
  67. ->exclude('plugin/buycourses/src/Requests')
  68. ->exclude('plugin/vchamilo/cli')
  69. ->exclude('plugin/kannelsms/vendor')
  70. ->exclude('plugin/clockworksms/vendor')
  71. ->exclude('plugin/pens/lib')
  72. ->exclude('plugin/bbb/lib')
  73. ->exclude('plugin/ims_lti')
  74. ->exclude('plugin/sepe/src/wsse')
  75. ->exclude('plugin/test2pdf/class')
  76. ->exclude('plugin/jcapture/src')
  77. ->exclude('plugin/jcapture/lib')
  78. ->exclude('tests')
  79. ->exclude('var')
  80. ->exclude('vendor')
  81. ->exclude('web')
  82. ->notPath('main/admin/db.php')
  83. ->notPath('main/admin/ldap_synchro.php')
  84. ->notPath('main/chat/emoji_strategy.php')
  85. ->in(__DIR__)
  86. ;
  87. return PhpCsFixer\Config::create()
  88. ->setRules(
  89. $rules
  90. )
  91. ->setFinder($finder);