60 lines
2.1 KiB
PHP
60 lines
2.1 KiB
PHP
<?php
|
|
|
|
$finder = PhpCsFixer\Finder::create()
|
|
->files()
|
|
->in(__DIR__ . '/src')
|
|
->in(__DIR__ . '/tests');
|
|
|
|
return PhpCsFixer\Config::create()
|
|
->setFinder($finder)
|
|
->setRiskyAllowed(true)
|
|
->setRules([
|
|
'@PSR2' => true,
|
|
'align_multiline_comment' => true,
|
|
'array_syntax' => ['syntax' => 'short'],
|
|
'blank_line_after_opening_tag' => true,
|
|
'cast_spaces' => true,
|
|
'class_attributes_separation' => ['elements' => ['method']],
|
|
'global_namespace_import' => [
|
|
'import_classes' => true,
|
|
'import_constants' => true,
|
|
'import_functions' => true,
|
|
],
|
|
'linebreak_after_opening_tag' => true,
|
|
'lowercase_cast' => true,
|
|
'lowercase_static_reference' => true,
|
|
'method_chaining_indentation' => true,
|
|
'modernize_types_casting' => true,
|
|
'multiline_comment_opening_closing' => true,
|
|
'multiline_whitespace_before_semicolons' => true,
|
|
'native_function_casing' => true,
|
|
'no_alternative_syntax' => true,
|
|
'no_extra_blank_lines' => true,
|
|
'no_leading_import_slash' => true,
|
|
'no_mixed_echo_print' => ['use' => 'print'],
|
|
'no_short_bool_cast' => true,
|
|
'no_singleline_whitespace_before_semicolons' => true,
|
|
'no_spaces_around_offset' => true,
|
|
'no_trailing_comma_in_list_call' => true,
|
|
'no_trailing_comma_in_singleline_array' => true,
|
|
'no_unneeded_control_parentheses' => true,
|
|
'no_unused_imports' => true,
|
|
'no_useless_return' => true,
|
|
'no_whitespace_before_comma_in_array' => true,
|
|
'no_whitespace_in_blank_line' => true,
|
|
'normalize_index_brace' => true,
|
|
'nullable_type_declaration_for_default_null_value' => true,
|
|
'ordered_imports' => [
|
|
'sort_algorithm' => 'alpha'
|
|
],
|
|
'ordered_interfaces' => [
|
|
'direction' => 'ascend',
|
|
'order' => 'alpha',
|
|
],
|
|
'single_quote' => true,
|
|
'space_after_semicolon' => true,
|
|
'standardize_not_equals' => true,
|
|
'ternary_operator_spaces' => true,
|
|
'ternary_to_null_coalescing' => true
|
|
]);
|