|
| 1 | +<?php |
| 2 | + |
| 3 | +$header = <<<'EOF' |
| 4 | +This file is part of PHP CS Fixer / PHPUnit Constraint IsIdenticalString. |
| 5 | +
|
| 6 | +(c) Dariusz Rumiński <dariusz.ruminski@gmail.com> |
| 7 | +
|
| 8 | +This source file is subject to the MIT license that is bundled |
| 9 | +with this source code in the file LICENSE. |
| 10 | +EOF; |
| 11 | + |
| 12 | +$finder = PhpCsFixer\Finder::create() |
| 13 | + ->exclude('tests/Fixtures') |
| 14 | + ->in(__DIR__) |
| 15 | +; |
| 16 | + |
| 17 | +if (PHP_VERSION_ID < 70000) { |
| 18 | + $finder |
| 19 | + ->notPath('tests/Test/Constraint/IsIdenticalStringForV7.php') |
| 20 | + ; |
| 21 | +} |
| 22 | + |
| 23 | +return PhpCsFixer\Config::create() |
| 24 | + ->setRiskyAllowed(true) |
| 25 | + ->setRules([ |
| 26 | + // '@PHP56Migration' => true, |
| 27 | + '@PHPUnit60Migration:risky' => true, |
| 28 | + '@Symfony' => true, |
| 29 | + '@Symfony:risky' => true, |
| 30 | + 'align_multiline_comment' => true, |
| 31 | + 'array_indentation' => true, |
| 32 | + 'array_syntax' => ['syntax' => 'short'], |
| 33 | + 'blank_line_before_statement' => true, |
| 34 | + 'combine_consecutive_issets' => true, |
| 35 | + 'combine_consecutive_unsets' => true, |
| 36 | + 'comment_to_phpdoc' => true, |
| 37 | + 'compact_nullable_typehint' => true, |
| 38 | + 'escape_implicit_backslashes' => true, |
| 39 | + 'explicit_indirect_variable' => true, |
| 40 | + 'explicit_string_variable' => true, |
| 41 | + 'final_internal_class' => true, |
| 42 | + 'fully_qualified_strict_types' => true, |
| 43 | + 'function_to_constant' => ['functions' => ['get_class', 'get_called_class', 'php_sapi_name', 'phpversion', 'pi']], |
| 44 | + 'header_comment' => ['header' => $header], |
| 45 | + 'heredoc_to_nowdoc' => true, |
| 46 | + 'list_syntax' => ['syntax' => 'long'], |
| 47 | + 'method_argument_space' => ['ensure_fully_multiline' => true], |
| 48 | + 'method_chaining_indentation' => true, |
| 49 | + 'multiline_comment_opening_closing' => true, |
| 50 | + 'no_alternative_syntax' => true, |
| 51 | + 'no_extra_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']], |
| 52 | + 'no_null_property_initialization' => true, |
| 53 | + 'no_short_echo_tag' => true, |
| 54 | + 'no_superfluous_elseif' => true, |
| 55 | + 'no_unneeded_curly_braces' => true, |
| 56 | + 'no_unneeded_final_method' => true, |
| 57 | + 'no_unreachable_default_argument_value' => true, |
| 58 | + 'no_useless_else' => true, |
| 59 | + 'no_useless_return' => true, |
| 60 | + 'ordered_class_elements' => true, |
| 61 | + 'ordered_imports' => true, |
| 62 | + 'php_unit_ordered_covers' => true, |
| 63 | + 'php_unit_set_up_tear_down_visibility' => true, |
| 64 | + 'php_unit_strict' => true, |
| 65 | + 'php_unit_test_annotation' => true, |
| 66 | + 'php_unit_test_class_requires_covers' => true, |
| 67 | + 'phpdoc_add_missing_param_annotation' => true, |
| 68 | + 'phpdoc_order' => true, |
| 69 | + 'phpdoc_types_order' => true, |
| 70 | + 'semicolon_after_instruction' => true, |
| 71 | + 'single_line_comment_style' => true, |
| 72 | + 'strict_comparison' => true, |
| 73 | + 'strict_param' => true, |
| 74 | + 'string_line_ending' => true, |
| 75 | + 'yoda_style' => true, |
| 76 | + ]) |
| 77 | + ->setFinder($finder) |
| 78 | +; |
0 commit comments