Files
2026-10-22 12:58:21 +02:00

122 lines
5.8 KiB
PHP

<?php
$config = new PhpCsFixer\Config();
return $config->setRules([
'align_multiline_comment' => [
'comment_type' => 'all_multiline'
],
'array_indentation' => true,
'array_syntax' => [
'syntax' => 'short'
],
'binary_operator_spaces' => [
'operators' => [
'=>' => 'align',
]
],
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_statement' => false,
'braces' => [
'position_after_anonymous_constructs' => 'next',
'position_after_control_structures' => 'same',
'position_after_functions_and_oop_constructs' => 'next'
],
'cast_spaces' => true,
'class_attributes_separation' => false,
'class_definition' => true,
'concat_space' => [
'spacing' => 'one'
],
'declare_strict_types' => true,
'declare_equal_normalize' => true,
'declare_strict_types' => true,
'elseif' => true,
'encoding' => true,
'full_opening_tag' => true,
'function_declaration' => true,
'function_typehint_space' => true,
'implode_call' => true,
'include' => true,
'indentation_type' => true,
'line_ending' => true,
'linebreak_after_opening_tag' => true,
'logical_operators' => true,
'lowercase_cast' => true,
'constant_case' => true,
'lowercase_keywords' => true,
'lowercase_static_reference' => true,
'magic_constant_casing' => true,
'magic_method_casing' => true,
'method_argument_space' => true,
'method_chaining_indentation' => true,
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => true,
'native_function_casing' => true,
'native_function_type_declaration_casing' => true,
'new_with_braces' => true,
'no_alias_functions' => true,
'no_alternative_syntax' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_blank_lines_before_namespace' => false,
'no_break_comment' => [
'comment_text' => 'FIXME: No break. Please add proper comment if intentional'
],
'no_closing_tag' => true,
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => true,
'no_multiline_whitespace_around_double_arrow' => true,
'echo_tag_syntax' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_after_function_name' => true,
'no_spaces_around_offset' => true,
'no_spaces_inside_parenthesis' => true,
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_unneeded_control_parentheses' => true,
'no_unneeded_curly_braces' => false,
'no_useless_else' => false,
'no_useless_return' => false,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
'normalize_index_brace' => true,
'not_operator_with_space' => false,
'not_operator_with_successor_space' => false,
'object_operator_without_whitespace' => true,
'ordered_class_elements' => false,
'ordered_imports' => false,
'ordered_interfaces' => false,
'pow_to_exponentiation' => false,
'protected_to_private' => false,
'return_type_declaration' => true,
'self_accessor' => true,
'semicolon_after_instruction' => true,
'single_blank_line_before_namespace' => true,
'single_class_element_per_statement' => true,
'single_import_per_statement' => true,
'single_line_after_imports' => true,
'single_quote' => true,
'single_trait_insert_per_statement' => true,
'space_after_semicolon' => true,
'standardize_not_equals' => true,
'switch_case_semicolon_to_colon' => true,
'switch_case_space' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline' => false,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'visibility_required' => true,
'whitespace_after_comma_in_array' => true,
])
->setIndent(' ')
->setLineEnding("\n")
->setRiskyAllowed(true)
->setUsingCache(false);