|
<?php |
|
|
|
$config = new \PhpCsFixer\Config(); |
|
$config->setRules([ |
|
'@PSR2' => true, |
|
'array_indentation' => true, |
|
'array_syntax' => ['syntax' => 'short'], |
|
'combine_consecutive_unsets' => true, |
|
'class_attributes_separation' => ['elements' => ['method' => 'one']], |
|
'multiline_whitespace_before_semicolons' => true, |
|
'single_quote' => true, |
|
'binary_operator_spaces' => [], |
|
'braces' => [ |
|
'allow_single_line_closure' => true, |
|
], |
|
'concat_space' => ['spacing' => 'none'], |
|
'declare_equal_normalize' => true, |
|
'function_typehint_space' => true, |
|
'single_line_comment_style' => ['comment_types' => ['hash']], |
|
'include' => true, |
|
'lowercase_cast' => true, |
|
'no_extra_blank_lines' => [ |
|
'tokens' => [ |
|
'curly_brace_block', |
|
'extra', |
|
'parenthesis_brace_block', |
|
'square_brace_block', |
|
'throw', |
|
'use', |
|
], |
|
], |
|
'no_multiline_whitespace_around_double_arrow' => true, |
|
'no_spaces_around_offset' => true, |
|
'no_unused_imports' => true, |
|
'ordered_imports' => ['sort_algorithm' => 'alpha'], |
|
'no_whitespace_before_comma_in_array' => true, |
|
'no_whitespace_in_blank_line' => true, |
|
'object_operator_without_whitespace' => true, |
|
'phpdoc_order' => false, |
|
'phpdoc_summary' => true, |
|
'return_type_declaration' => ['space_before' => 'one'], |
|
'single_blank_line_before_namespace' => true, |
|
'ternary_operator_spaces' => true, |
|
'trim_array_spaces' => true, |
|
'trailing_comma_in_multiline' => ['elements' => ['arrays']], |
|
'unary_operator_spaces' => true, |
|
'whitespace_after_comma_in_array' => true, |
|
'function_declaration' => true, |
|
'indentation_type' => true, |
|
'no_spaces_after_function_name' => true, |
|
'no_spaces_inside_parenthesis' => true, |
|
'not_operator_with_successor_space' => true, |
|
]) |
|
->setLineEnding("\n") |
|
->setUsingCache(false); |
|
|
|
return $config; |