blob: 22b4ada280179617da84f00cefb958c00ef61c52 [file] [log] [blame]
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +01001<?php
2
3declare(strict_types=1);
4
5return (new PhpCsFixer\Config())
6 ->setRiskyAllowed(true)
7 ->setRules([
8 '@DoctrineAnnotation' => true,
9 '@Symfony' => true,
10 '@Symfony:risky' => true,
11 '@PHPUnit75Migration:risky' => true,
12 '@PHP71Migration' => true,
13 '@PHP70Migration:risky' => true, // @TODO with next major version
14 'align_multiline_comment' => ['comment_type' => 'all_multiline'],
15 'array_indentation' => true,
16 'array_syntax' => ['syntax' => 'short'],
17 'binary_operator_spaces' => ['default' => 'align_single_space'],
18 'blank_line_before_statement' => true,
19 'class_definition' => ['single_item_single_line' => true],
20 'compact_nullable_typehint' => true,
21 'concat_space' => ['spacing' => 'one'],
22 'echo_tag_syntax' => ['format' => 'long'],
23 'error_suppression' => false,
24 'escape_implicit_backslashes' => true,
25 'explicit_indirect_variable' => true,
26 'explicit_string_variable' => true,
27 'fully_qualified_strict_types' => true,
28 'heredoc_to_nowdoc' => true,
29 'list_syntax' => ['syntax' => 'long'],
30 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
31 'method_chaining_indentation' => true,
32 'multiline_comment_opening_closing' => true,
33 'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'],
34 'native_constant_invocation' => true,
35 'native_function_invocation' => ['include' => ['@internal']],
36 'no_alternative_syntax' => true,
37 'no_break_comment' => true,
38 'no_extra_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']],
39 'no_null_property_initialization' => true,
40 'no_php4_constructor' => true,
41 'no_superfluous_elseif' => true,
42 'no_unneeded_curly_braces' => true,
43 'no_unneeded_final_method' => true,
44 'no_unreachable_default_argument_value' => true,
45 'no_useless_else' => true,
46 'no_useless_return' => true,
47 'ordered_imports' => true,
48 'php_unit_method_casing' => true,
49 'php_unit_set_up_tear_down_visibility' => true,
50 'php_unit_strict' => true,
51 'php_unit_test_annotation' => true,
52 'php_unit_test_case_static_method_calls' => true,
53 'php_unit_test_class_requires_covers' => false,
54 'phpdoc_add_missing_param_annotation' => true,
55 'phpdoc_order' => true,
56 'phpdoc_order_by_value' => true,
57 'phpdoc_types_order' => true,
58 'random_api_migration' => true,
59 'semicolon_after_instruction' => true,
60 'simplified_null_return' => true,
61 'single_line_comment_style' => true,
62 'single_line_throw' => false,
63 'space_after_semicolon' => true,
64 'static_lambda' => true,
65 'strict_comparison' => true,
66 'string_line_ending' => true,
67 ])
68 ->setFinder(
69 PhpCsFixer\Finder::create()
70 ->in(__DIR__ . '/src')
71 ->in(__DIR__ . '/tests')
72 )
73;