Debian Codegraph @

vendor/jfcherng/php-diff/.php-cs-fixer.dist.php

raw
1 <?php
2
3 $config = (new PhpCsFixer\Config())
4 ->setIndent(" ")
5 ->setLineEnding("\n")
6 ->setCacheFile(__DIR__ . '/.php-cs-fixer.cache')
7 ->setRiskyAllowed(true)
8 ->setRules([
9 '@PHP71Migration' => true,
10 '@PHP71Migration:risky' => true,
11 '@PHP73Migration' => true,
12 '@PHP74Migration' => true,
13 '@PHP74Migration:risky' => true,
14 '@PHP80Migration' => false,
15 '@PHP80Migration:risky' => true,
16 '@PHP81Migration' => false,
17 '@PhpCsFixer' => true,
18 '@PhpCsFixer:risky' => true,
19 '@PSR12' => true,
20 '@Symfony' => true,
21 '@Symfony:risky' => true,
22 'align_multiline_comment' => true,
23 'array_indentation' => true,
24 'array_syntax' => ['syntax' => 'short'],
25 'combine_consecutive_issets' => true,
26 'combine_consecutive_unsets' => true,
27 'combine_nested_dirname' => true,
28 'comment_to_phpdoc' => true,
29 'compact_nullable_type_declaration' => true,
30 'concat_space' => ['spacing' => 'one'],
31 'echo_tag_syntax' => ['format' => 'short'],
32 'fully_qualified_strict_types' => true,
33 'heredoc_indentation' => false, // disabling this makes test cases more readable
34 'linebreak_after_opening_tag' => true,
35 'list_syntax' => ['syntax' => 'short'],
36 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
37 'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'],
38 'native_constant_invocation' => ['scope' => 'all'],
39 'native_function_invocation' => ['scope' => 'all', 'include' => ['@compiler_optimized']],
40 'native_type_declaration_casing' => true,
41 'no_alternative_syntax' => true,
42 'no_null_property_initialization' => true,
43 'no_superfluous_elseif' => true,
44 'no_trailing_whitespace_in_string' => false, // test cases have trailing spaces
45 'no_unneeded_control_parentheses' => true,
46 'no_useless_else' => true,
47 'no_useless_return' => true,
48 'not_operator_with_space' => false,
49 'not_operator_with_successor_space' => false,
50 'ordered_class_elements' => true,
51 'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['class', 'const', 'function']],
52 'ordered_interfaces' => true,
53 'php_unit_set_up_tear_down_visibility' => true,
54 'php_unit_strict' => true,
55 'php_unit_test_class_requires_covers' => true,
56 'phpdoc_add_missing_param_annotation' => true,
57 'phpdoc_order' => true,
58 'phpdoc_order_by_value' => ['annotations' => ['covers']],
59 'phpdoc_to_comment' => false,
60 'phpdoc_types_order' => true,
61 'pow_to_exponentiation' => true,
62 'random_api_migration' => true,
63 'return_assignment' => false,
64 'simple_to_complex_string_variable' => true,
65 'single_line_comment_style' => true,
66 'single_trait_insert_per_statement' => true,
67 'static_lambda' => false,
68 'strict_comparison' => false,
69 'strict_param' => false,
70 'string_implicit_backslashes' => false,
71 'string_line_ending' => true,
72 'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arrays', 'arguments']],
73 'types_spaces' => ['space_multiple_catch' => 'single'],
74 'yoda_style' => false,
75 ])
76 ->setFinder(
77 PhpCsFixer\Finder::create()
78 ->notPath([
79 '/branch-\\w+/', // git worktree
80 'example/demo_web.php',
81 ])
82 ->exclude('libs')
83 ->exclude('tests/data')
84 ->exclude('tests/Fixtures')
85 ->exclude('var')
86 ->exclude('vendor')
87 ->in(__DIR__)
88 )
89 ;
90
91 return $config;