Debian Codegraph @

vendor/jfcherng/php-sequence-matcher/.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_typehint' => true,
30 'concat_space' => ['spacing' => 'one'],
31 'echo_tag_syntax' => ['format' => 'short'],
32 'escape_implicit_backslashes' => false,
33 'fully_qualified_strict_types' => true,
34 'heredoc_indentation' => false, // disabling this makes test cases more readable
35 'linebreak_after_opening_tag' => true,
36 'list_syntax' => ['syntax' => 'short'],
37 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
38 'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'],
39 'native_constant_invocation' => ['scope' => 'all'],
40 'native_function_invocation' => ['scope' => 'all', 'include' => ['@compiler_optimized']],
41 'native_function_type_declaration_casing' => true,
42 'no_alternative_syntax' => true,
43 'no_null_property_initialization' => true,
44 'no_superfluous_elseif' => true,
45 'no_trailing_whitespace_in_string' => false, // test cases have trailing spaces
46 'no_unneeded_control_parentheses' => true,
47 'no_useless_else' => true,
48 'no_useless_return' => true,
49 'not_operator_with_space' => false,
50 'not_operator_with_successor_space' => false,
51 'ordered_class_elements' => true,
52 'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['class', 'const', 'function']],
53 'ordered_interfaces' => true,
54 'php_unit_set_up_tear_down_visibility' => true,
55 'php_unit_strict' => true,
56 'php_unit_test_class_requires_covers' => true,
57 'phpdoc_add_missing_param_annotation' => true,
58 'phpdoc_order' => true,
59 'phpdoc_order_by_value' => ['annotations' => ['covers']],
60 'phpdoc_to_comment' => false,
61 'phpdoc_types_order' => true,
62 'pow_to_exponentiation' => true,
63 'random_api_migration' => true,
64 'return_assignment' => false,
65 'simple_to_complex_string_variable' => true,
66 'single_line_comment_style' => true,
67 'single_trait_insert_per_statement' => true,
68 'static_lambda' => false,
69 'strict_comparison' => false,
70 'strict_param' => 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('/branch-\\w+/') // git worktree
79 ->exclude('libs')
80 ->exclude('tests/data')
81 ->exclude('tests/Fixtures')
82 ->exclude('var')
83 ->exclude('vendor')
84 ->in(__DIR__)
85 )
86 ;
87
88 return $config;