123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379 |
- <?php
- declare(strict_types = 1);
- $config = new PhpCsFixer\Config();
- return $config
- ->setRiskyAllowed(true)
- ->setRules([
-
- 'align_multiline_comment' => ['comment_type' => 'phpdocs_like'],
-
- 'array_indentation' => true,
-
- 'array_push' => true,
-
- 'array_syntax' => ['syntax' => 'short'],
-
- 'assign_null_coalescing_to_coalesce_equal' => true,
-
- 'binary_operator_spaces' => ['default' => 'align_single_space_minimal', 'operators' => ['??' => 'align']],
-
- 'blank_line_after_namespace' => true,
-
- 'blank_line_after_opening_tag' => true,
-
- 'braces' => ['allow_single_line_anonymous_class_with_empty_body' => true, 'allow_single_line_closure' => true, 'position_after_functions_and_oop_constructs' => 'next'],
-
- 'cast_spaces' => true,
-
- 'class_definition' => ['single_item_single_line' => true, 'single_line' => true],
-
- 'combine_consecutive_issets' => true,
-
- 'combine_consecutive_unsets' => true,
-
- 'combine_nested_dirname' => true,
-
- 'comment_to_phpdoc' => false,
-
- 'compact_nullable_typehint' => true,
-
- 'concat_space' => ['spacing' => 'one'],
-
- 'constant_case' => true,
-
- 'declare_equal_normalize' => ['space' => 'single'],
-
- 'declare_parentheses' => true,
-
- 'declare_strict_types' => true,
-
- 'dir_constant' => true,
-
- 'echo_tag_syntax' => true,
-
- 'elseif' => true,
-
- 'empty_loop_body' => true,
-
- 'empty_loop_condition' => true,
-
- 'encoding' => true,
-
- 'ereg_to_preg' => true,
-
- 'escape_implicit_backslashes' => true,
-
- 'explicit_indirect_variable' => true,
-
- 'explicit_string_variable' => true,
-
- 'full_opening_tag' => true,
-
- 'fully_qualified_strict_types' => true,
-
- 'function_declaration' => ['closure_function_spacing' => 'one'],
-
- 'function_typehint_space' => true,
-
- 'global_namespace_import' => true,
-
- 'heredoc_indentation' => true,
-
- 'heredoc_to_nowdoc' => true,
-
- 'implode_call' => true,
-
- 'increment_style' => true,
-
- 'indentation_type' => true,
-
- 'lambda_not_used_import' => true,
-
- 'line_ending' => true,
-
- 'linebreak_after_opening_tag' => true,
-
- 'list_syntax' => ['syntax' => 'short'],
-
- 'logical_operators' => true,
-
- 'lowercase_cast' => true,
-
- 'lowercase_keywords' => true,
-
- 'lowercase_static_reference' => true,
-
- 'magic_constant_casing' => true,
-
- 'magic_method_casing' => true,
-
- 'mb_str_functions' => true,
-
- 'method_argument_space' => ['after_heredoc' => true, 'on_multiline' => 'ensure_fully_multiline'],
-
- 'method_chaining_indentation' => true,
-
- 'modernize_strpos' => true,
-
- 'modernize_types_casting' => true,
-
- 'multiline_comment_opening_closing' => true,
-
- 'multiline_whitespace_before_semicolons' => true,
-
- 'native_constant_invocation' => true,
-
- 'native_function_casing' => true,
-
- 'native_function_invocation' => true,
-
- 'native_function_type_declaration_casing' => true,
-
- 'no_alias_language_construct_call' => true,
-
- 'no_alternative_syntax' => true,
-
- 'no_blank_lines_after_class_opening' => true,
-
- 'no_blank_lines_after_phpdoc' => true,
-
- 'no_break_comment' => true,
-
- 'no_closing_tag' => true,
-
- 'no_empty_comment' => true,
-
- 'no_empty_phpdoc' => true,
-
- 'no_empty_statement' => true,
-
- 'no_extra_blank_lines' => true,
-
- 'no_leading_import_slash' => true,
-
- 'no_leading_namespace_whitespace' => true,
-
- 'no_mixed_echo_print' => true,
-
- 'no_multiline_whitespace_around_double_arrow' => true,
-
- 'no_null_property_initialization' => true,
-
- 'no_short_bool_cast' => true,
-
- 'no_singleline_whitespace_before_semicolons' => true,
-
- 'no_space_around_double_colon' => true,
-
- 'no_spaces_after_function_name' => true,
-
- 'no_spaces_around_offset' => true,
-
- 'no_spaces_inside_parenthesis' => true,
-
- 'no_superfluous_phpdoc_tags' => false,
-
- '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' => true,
-
- 'no_unreachable_default_argument_value' => true,
-
- 'no_unset_cast' => true,
-
- 'no_unused_imports' => true,
-
- 'no_useless_return' => true,
-
- 'no_whitespace_before_comma_in_array' => true,
-
- 'no_whitespace_in_blank_line' => true,
-
- 'non_printable_character' => true,
-
- 'normalize_index_brace' => true,
-
- 'nullable_type_declaration_for_default_null_value' => true,
-
- 'object_operator_without_whitespace' => true,
-
- 'operator_linebreak' => true,
-
- 'ordered_imports' => true,
-
- 'php_unit_construct' => true,
-
- 'php_unit_dedicate_assert' => true,
-
- 'php_unit_dedicate_assert_internal_type' => true,
-
- 'php_unit_expectation' => true,
-
- 'php_unit_fqcn_annotation' => true,
-
- 'php_unit_method_casing' => true,
-
- 'php_unit_mock_short_will_return' => true,
-
- 'php_unit_namespaced' => true,
-
- 'php_unit_no_expectation_annotation' => true,
-
- 'php_unit_set_up_tear_down_visibility' => true,
-
- 'php_unit_strict' => true,
-
- 'php_unit_test_case_static_method_calls' => true,
-
- 'phpdoc_add_missing_param_annotation' => true,
-
- 'phpdoc_align' => true,
-
- 'phpdoc_annotation_without_dot' => true,
-
- 'phpdoc_indent' => true,
-
- 'phpdoc_inline_tag_normalizer' => true,
-
- 'phpdoc_line_span' => true,
-
- 'phpdoc_no_access' => true,
-
- 'phpdoc_no_alias_tag' => true,
-
- 'phpdoc_no_empty_return' => true,
-
- 'phpdoc_no_useless_inheritdoc' => true,
-
- 'phpdoc_order' => true,
-
- 'phpdoc_order_by_value' => ['annotations' => ['covers', 'throws']],
-
- 'phpdoc_return_self_reference' => true,
-
- 'phpdoc_scalar' => true,
-
- 'phpdoc_separation' => true,
-
- 'phpdoc_single_line_var_spacing' => true,
-
- 'phpdoc_tag_casing' => true,
-
-
-
-
-
-
-
-
- 'phpdoc_trim' => true,
-
- 'phpdoc_trim_consecutive_blank_line_separation' => true,
-
- 'phpdoc_types' => true,
-
- 'phpdoc_types_order' => true,
-
- 'phpdoc_var_annotation_correct_order' => true,
-
- 'pow_to_exponentiation' => true,
-
- 'random_api_migration' => true,
-
- 'regular_callable_call' => true,
-
- 'return_assignment' => true,
-
- 'return_type_declaration' => true,
-
- 'self_accessor' => true,
-
- 'semicolon_after_instruction' => true,
-
- 'set_type_to_cast' => true,
-
- 'short_scalar_cast' => true,
-
- 'simple_to_complex_string_variable' => true,
-
- 'simplified_if_return' => true,
-
- 'simplified_null_return' => true,
-
- 'single_blank_line_at_eof' => true,
-
- 'single_blank_line_before_namespace' => true,
-
- 'single_class_element_per_statement' => true,
-
- 'single_import_per_statement' => true,
-
- 'single_line_after_imports' => true,
-
- 'single_line_comment_style' => true,
-
- 'single_quote' => true,
-
- 'single_space_after_construct' => true,
-
- 'single_trait_insert_per_statement' => true,
-
- 'space_after_semicolon' => true,
-
- 'standardize_increment' => true,
-
- 'standardize_not_equals' => true,
-
- 'string_length_to_empty' => true,
-
- 'switch_case_semicolon_to_colon' => true,
-
- 'switch_case_space' => true,
-
- 'switch_continue_to_break' => true,
-
- 'ternary_operator_spaces' => true,
-
- 'ternary_to_elvis_operator' => true,
-
- 'ternary_to_null_coalescing' => true,
-
- 'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arguments', 'arrays', 'parameters']],
-
- 'trim_array_spaces' => true,
-
- 'types_spaces' => true,
-
- 'unary_operator_spaces' => true,
-
- 'use_arrow_functions' => true,
-
- 'visibility_required' => true,
-
- 'whitespace_after_comma_in_array' => true,
- ])
- ->setFinder(
- PhpCsFixer\Finder::create()
- ->exclude('vendor')
- ->exclude('var')
- ->exclude('docker')
- ->exclude('src/Entity')
- ->notPath('src/Core/DB/DefaultSettings.php')
- ->in(__DIR__),
- );
|