|
| 1 | +<?php |
| 2 | + |
| 3 | +$header = <<<'HEADER' |
| 4 | +This file is part of the Mercure Component project. |
| 5 | +
|
| 6 | +(c) Kévin Dunglas <[email protected]> |
| 7 | +
|
| 8 | +For the full copyright and license information, please view the LICENSE |
| 9 | +file that was distributed with this source code. |
| 10 | +HEADER; |
| 11 | + |
| 12 | +$finder = PhpCsFixer\Finder::create()->in(__DIR__); |
| 13 | + |
| 14 | +return PhpCsFixer\Config::create() |
| 15 | + ->setRiskyAllowed(true) |
| 16 | + ->setRules([ |
| 17 | + '@Symfony' => true, |
| 18 | + '@Symfony:risky' => true, |
| 19 | + 'array_syntax' => [ |
| 20 | + 'syntax' => 'short', |
| 21 | + ], |
| 22 | + 'braces' => [ |
| 23 | + 'allow_single_line_closure' => true, |
| 24 | + ], |
| 25 | + 'declare_strict_types' => true, |
| 26 | + 'header_comment' => [ |
| 27 | + 'header' => $header, |
| 28 | + 'location' => 'after_open', |
| 29 | + ], |
| 30 | + 'modernize_types_casting' => true, |
| 31 | + 'native_function_invocation' => true, |
| 32 | + 'no_extra_consecutive_blank_lines' => [ |
| 33 | + 'break', |
| 34 | + 'continue', |
| 35 | + 'curly_brace_block', |
| 36 | + 'extra', |
| 37 | + 'parenthesis_brace_block', |
| 38 | + 'return', |
| 39 | + 'square_brace_block', |
| 40 | + 'throw', |
| 41 | + 'use', |
| 42 | + ], |
| 43 | + 'no_useless_else' => true, |
| 44 | + 'no_useless_return' => true, |
| 45 | + 'ordered_imports' => true, |
| 46 | + 'phpdoc_add_missing_param_annotation' => [ |
| 47 | + 'only_untyped' => true, |
| 48 | + ], |
| 49 | + 'phpdoc_order' => true, |
| 50 | + 'psr4' => true, |
| 51 | + 'semicolon_after_instruction' => true, |
| 52 | + 'strict_comparison' => true, |
| 53 | + 'strict_param' => true, |
| 54 | + 'ternary_to_null_coalescing' => true, |
| 55 | + 'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced'], |
| 56 | + ]) |
| 57 | + ->setFinder($finder) |
| 58 | +; |
0 commit comments