Created
June 4, 2020 01:16
-
-
Save jiahong96/239c6179f2522624b1ef72467a997708 to your computer and use it in GitHub Desktop.
php cs fixer rules for Laravel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return PhpCsFixer\Config::create() | |
->setRules(array( | |
'@PSR2' => true, | |
'concat_space' => array('spacing' => 'none'), | |
'array_indentation' => true, | |
'no_unused_imports' => true, | |
'array_syntax' => array('syntax' => 'short'), | |
'combine_consecutive_unsets' => true, | |
'method_separation' => true, | |
'no_multiline_whitespace_before_semicolons' => true, | |
'single_quote' => true, | |
'binary_operator_spaces' => array( | |
'align_double_arrow' => false, | |
'align_equals' => false, | |
), | |
'braces' => array( | |
'allow_single_line_closure' => true, | |
'position_after_functions_and_oop_constructs' => 'next' | |
), | |
'declare_equal_normalize' => true, | |
'function_typehint_space' => true, | |
'hash_to_slash_comment' => true, | |
'include' => true, | |
'lowercase_cast' => true, | |
'no_extra_consecutive_blank_lines' => array( | |
'curly_brace_block', | |
'extra', | |
'parenthesis_brace_block', | |
'throw', | |
'use', | |
), | |
'no_multiline_whitespace_around_double_arrow' => true, | |
'no_spaces_after_function_name' => true, | |
'no_spaces_around_offset' => true, | |
'no_whitespace_before_comma_in_array' => true, | |
'no_whitespace_in_blank_line' => true, | |
'object_operator_without_whitespace' => true, | |
'single_blank_line_before_namespace' => true, | |
'ternary_operator_spaces' => true, | |
'trim_array_spaces' => true, | |
'unary_operator_spaces' => true, | |
'whitespace_after_comma_in_array' => true, | |
'method_chaining_indentation' => true, | |
)) | |
->setLineEnding("\n") | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment