|
| 1 | +<?php |
| 2 | +$headerTemplate = <<<EOF |
| 3 | +This file is part of the "image_compression" Extension for TYPO3 CMS. |
| 4 | +
|
| 5 | +For the full copyright and license information, please read the |
| 6 | +LICENSE file that was distributed with this source code. |
| 7 | +EOF; |
| 8 | + |
| 9 | +$config = new PhpCsFixer\Config(); |
| 10 | +$config->setRiskyAllowed(true); |
| 11 | +$config->getFinder()->in(__DIR__); |
| 12 | +$config->getFinder()->exclude(['.Build', 'var']); |
| 13 | +$config->setRules([ |
| 14 | + '@DoctrineAnnotation' => true, |
| 15 | + '@PSR2' => true, |
| 16 | + 'array_syntax' => ['syntax' => 'short'], |
| 17 | + 'blank_line_after_opening_tag' => true, |
| 18 | + 'braces' => ['allow_single_line_closure' => true], |
| 19 | + 'cast_spaces' => ['space' => 'none'], |
| 20 | + 'compact_nullable_typehint' => true, |
| 21 | + 'concat_space' => ['spacing' => 'one'], |
| 22 | + 'declare_equal_normalize' => ['space' => 'none'], |
| 23 | + 'dir_constant' => true, |
| 24 | + 'function_typehint_space' => true, |
| 25 | + 'header_comment' => [ |
| 26 | + 'header' => $headerTemplate, |
| 27 | + 'commentType' => 'comment', |
| 28 | + 'location' => 'after_declare_strict', |
| 29 | + 'separate' => 'both', |
| 30 | + ], |
| 31 | + 'lowercase_cast' => true, |
| 32 | + 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], |
| 33 | + 'modernize_types_casting' => true, |
| 34 | + 'native_function_casing' => true, |
| 35 | + 'new_with_braces' => true, |
| 36 | + 'no_alias_functions' => true, |
| 37 | + 'no_blank_lines_after_phpdoc' => true, |
| 38 | + 'no_empty_phpdoc' => true, |
| 39 | + 'no_empty_statement' => true, |
| 40 | + 'no_extra_blank_lines' => true, |
| 41 | + 'no_leading_import_slash' => true, |
| 42 | + 'no_leading_namespace_whitespace' => true, |
| 43 | + 'no_null_property_initialization' => true, |
| 44 | + 'no_short_bool_cast' => true, |
| 45 | + 'no_singleline_whitespace_before_semicolons' => true, |
| 46 | + 'no_superfluous_elseif' => true, |
| 47 | + 'no_trailing_comma_in_singleline_array' => true, |
| 48 | + 'no_unneeded_control_parentheses' => true, |
| 49 | + 'no_unused_imports' => true, |
| 50 | + 'no_useless_else' => true, |
| 51 | + 'no_whitespace_in_blank_line' => true, |
| 52 | + 'ordered_imports' => true, |
| 53 | + 'php_unit_construct' => [ |
| 54 | + 'assertions' => ['assertEquals', 'assertSame', 'assertNotEquals', 'assertNotSame'], |
| 55 | + ], |
| 56 | + 'php_unit_mock_short_will_return' => true, |
| 57 | + 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], |
| 58 | + 'phpdoc_no_access' => true, |
| 59 | + 'phpdoc_no_empty_return' => true, |
| 60 | + 'phpdoc_no_package' => true, |
| 61 | + 'phpdoc_scalar' => true, |
| 62 | + 'phpdoc_trim' => true, |
| 63 | + 'phpdoc_types' => true, |
| 64 | + 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], |
| 65 | + 'return_type_declaration' => ['space_before' => 'none'], |
| 66 | + 'single_line_comment_style' => false, |
| 67 | + 'single_quote' => true, |
| 68 | + 'single_trait_insert_per_statement' => true, |
| 69 | + 'whitespace_after_comma_in_array' => true, |
| 70 | +]); |
| 71 | + |
| 72 | +return $config; |
0 commit comments