|
| 1 | +<?php |
| 2 | + |
| 3 | +$header = <<<EOF |
| 4 | +This file is part of the Contao Swiper Bundle. |
| 5 | +
|
| 6 | +(c) inspiredminds |
| 7 | +
|
| 8 | +@license LGPL-3.0-or-later |
| 9 | +EOF; |
| 10 | + |
| 11 | +$finder = PhpCsFixer\Finder::create() |
| 12 | + ->exclude('Resources/contao/templates') |
| 13 | + ->in([ |
| 14 | + __DIR__.'/src', |
| 15 | + ]) |
| 16 | +; |
| 17 | + |
| 18 | +return (new PhpCsFixer\Config()) |
| 19 | + ->setRules([ |
| 20 | + '@Symfony' => true, |
| 21 | + '@Symfony:risky' => true, |
| 22 | + '@PHP71Migration' => true, |
| 23 | + '@PHP71Migration:risky' => true, |
| 24 | + '@PHPUnit60Migration:risky' => true, |
| 25 | + 'align_multiline_comment' => true, |
| 26 | + 'array_indentation' => true, |
| 27 | + 'array_syntax' => ['syntax' => 'short'], |
| 28 | + 'combine_consecutive_issets' => true, |
| 29 | + 'combine_consecutive_unsets' => true, |
| 30 | + 'comment_to_phpdoc' => true, |
| 31 | + 'compact_nullable_typehint' => true, |
| 32 | + 'escape_implicit_backslashes' => true, |
| 33 | + 'fully_qualified_strict_types' => true, |
| 34 | + 'general_phpdoc_annotation_remove' => [ |
| 35 | + 'annotations' => [ |
| 36 | + 'author', |
| 37 | + 'expectedException', |
| 38 | + 'expectedExceptionMessage', |
| 39 | + ], |
| 40 | + ], |
| 41 | + 'header_comment' => ['header' => $header], |
| 42 | + 'heredoc_to_nowdoc' => true, |
| 43 | + 'linebreak_after_opening_tag' => true, |
| 44 | + 'list_syntax' => ['syntax' => 'short'], |
| 45 | + 'multiline_comment_opening_closing' => true, |
| 46 | + 'multiline_whitespace_before_semicolons' => [ |
| 47 | + 'strategy' => 'new_line_for_chained_calls', |
| 48 | + ], |
| 49 | + 'native_function_invocation' => [ |
| 50 | + 'include' => ['@compiler_optimized'], |
| 51 | + ], |
| 52 | + 'no_alternative_syntax' => true, |
| 53 | + 'no_binary_string' => true, |
| 54 | + 'no_null_property_initialization' => true, |
| 55 | + 'no_superfluous_elseif' => true, |
| 56 | + 'no_superfluous_phpdoc_tags' => 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_strict' => true, |
| 63 | + 'phpdoc_add_missing_param_annotation' => true, |
| 64 | + 'phpdoc_order' => true, |
| 65 | + 'phpdoc_trim_consecutive_blank_line_separation' => true, |
| 66 | + 'phpdoc_types_order' => [ |
| 67 | + 'null_adjustment' => 'always_last', |
| 68 | + 'sort_algorithm' => 'none', |
| 69 | + ], |
| 70 | + 'return_assignment' => true, |
| 71 | + 'strict_comparison' => true, |
| 72 | + 'strict_param' => true, |
| 73 | + 'string_line_ending' => true, |
| 74 | + 'void_return' => true, |
| 75 | + ]) |
| 76 | + ->setFinder($finder) |
| 77 | + ->setRiskyAllowed(true) |
| 78 | + ->setUsingCache(false) |
| 79 | +; |
0 commit comments