Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * PHP Coding Standards Fixer setting for Laravel 5 on FriendsOfPHP/PHP-CS-Fixer 1.*
  5. * Rules with psr1, psr2, phpdoc and some symfony rules.
  6. * Remove psr0.
  7. * Rules only apply directory and sub-directory inside "app".
  8. *
  9. * Save script to .php_cs and place .php_cs file in the root of your Laravel project
  10. *
  11. * Requirement:
  12. * composer require FriendsOfPHP/PHP-CS-Fixer@1.* --dev
  13. *
  14. * Run with command:
  15. * php-cs-fixer fix --config-file=.php_cs --verbose
  16. * php-cs-fixer fix /path/to/your/file_or_dir --config-file=.php_cs --verbose
  17. *
  18. * With composer:
  19. * Add below lines to composer.json
  20. * "scripts": {
  21. * "code-fixer": [
  22. * "php-cs-fixer fix --config-file=.php_cs --verbose"
  23. * ]
  24. * }
  25. *
  26. * then run
  27. * composer run-script code-fixer
  28. */
  29. $fixers = [
  30. 'blankline_after_open_tag',
  31. 'braces',
  32. 'class_definition',
  33. 'concat_without_spaces',
  34. 'double_arrow_multiline_whitespaces',
  35. 'duplicate_semicolon',
  36. 'elseif',
  37. 'empty_return',
  38. 'encoding',
  39. 'eof_ending',
  40. 'extra_empty_lines',
  41. 'function_call_space',
  42. 'function_declaration',
  43. 'include',
  44. 'indentation',
  45. 'join_function',
  46. 'line_after_namespace',
  47. 'linefeed',
  48. 'list_commas',
  49. 'logical_not_operators_with_successor_space',
  50. 'lowercase_constants',
  51. 'lowercase_keywords',
  52. 'method_argument_space',
  53. 'multiline_array_trailing_comma',
  54. 'multiline_spaces_before_semicolon',
  55. 'multiple_use',
  56. 'namespace_no_leading_whitespace',
  57. 'no_blank_lines_after_class_opening',
  58. 'no_empty_lines_after_phpdocs',
  59. 'no_trailing_whitespace_in_comment',
  60. 'object_operator',
  61. 'operators_spaces',
  62. 'parenthesis',
  63. 'php_closing_tag',
  64. 'phpdoc_indent',
  65. 'phpdoc_inline_tag',
  66. 'phpdoc_no_access',
  67. 'phpdoc_no_package',
  68. 'phpdoc_scalar',
  69. 'phpdoc_short_description',
  70. 'phpdoc_to_comment',
  71. 'phpdoc_trim',
  72. 'phpdoc_type_to_var',
  73. 'phpdoc_var_without_name',
  74. 'remove_leading_slash_use',
  75. 'remove_lines_between_uses',
  76. 'return',
  77. 'self_accessor',
  78. 'short_array_syntax',
  79. 'short_echo_tag',
  80. 'short_tag',
  81. 'single_array_no_trailing_comma',
  82. 'single_blank_line_before_namespace',
  83. 'single_line_after_imports',
  84. 'single_quote',
  85. 'spaces_before_semicolon',
  86. 'spaces_cast',
  87. 'standardize_not_equal',
  88. 'switch_case_semicolon_to_colon',
  89. 'switch_case_space',
  90. 'ternary_spaces',
  91. 'trailing_spaces',
  92. 'trim_array_spaces',
  93. 'unalign_equals',
  94. 'unary_operators_spaces',
  95. 'unused_use',
  96. 'visibility',
  97. 'whitespacy_lines',
  98. '-psr0',
  99. ];
  100.  
  101. return Symfony\CS\Config::create()
  102. ->fixers($fixers)
  103. ->finder(
  104. Symfony\CS\Finder::create()
  105. ->name('*.php')
  106. ->notName('*.blade.php')
  107. ->in(__DIR__.'/app/')
  108. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement