|
1 | 1 | <?php |
2 | 2 |
|
3 | | -$finder = PhpCsFixer\Finder::create() |
4 | | - ->in(__DIR__) |
5 | | - ->ignoreDotFiles(true) |
6 | | - ->ignoreVCS(true) |
7 | | - ->exclude(['build', 'vendor']) |
8 | | - ->files() |
9 | | - ->name('*.php') |
10 | | -; |
| 3 | +/* |
| 4 | + * This file is part of the CleverAge/DoctrineProcessBundle package. |
| 5 | + * |
| 6 | + * Copyright (c) 2017-2023 Clever-Age |
| 7 | + * |
| 8 | + * For the full copyright and license information, please view the LICENSE |
| 9 | + * file that was distributed with this source code. |
| 10 | + */ |
11 | 11 |
|
12 | | -$config = new PhpCsFixer\Config(); |
| 12 | +if (!file_exists(__DIR__.'/src')) { |
| 13 | + exit(0); |
| 14 | +} |
13 | 15 |
|
14 | | -return $config |
15 | | - ->setUsingCache(true) |
16 | | - ->setRiskyAllowed(true) |
17 | | - ->setFinder($finder) |
| 16 | +$fileHeaderComment = <<<'EOF' |
| 17 | +This file is part of the CleverAge/DoctrineProcessBundle package. |
| 18 | +
|
| 19 | +Copyright (c) 2017-2023 Clever-Age |
| 20 | +
|
| 21 | +For the full copyright and license information, please view the LICENSE |
| 22 | +file that was distributed with this source code. |
| 23 | +EOF; |
| 24 | + |
| 25 | +return (new PhpCsFixer\Config()) |
18 | 26 | ->setRules([ |
| 27 | + '@PHP71Migration' => true, |
| 28 | + '@PHPUnit75Migration:risky' => true, |
19 | 29 | '@Symfony' => true, |
20 | 30 | '@Symfony:risky' => true, |
21 | | - '@PHPUnit48Migration:risky' => true, |
22 | | - 'array_syntax' => ['syntax' => 'short'], |
23 | | - 'fopen_flags' => false, |
24 | | - 'ordered_imports' => true, |
25 | 31 | 'protected_to_private' => false, |
26 | | - // Part of @Symfony:risky in PHP-CS-Fixer 2.13.0. To be removed from the config file once upgrading |
27 | | - 'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced', 'strict' => true], |
28 | | - // Part of future @Symfony ruleset in PHP-CS-Fixer To be removed from the config file once upgrading |
29 | | - 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], |
30 | | - 'single_line_throw' => false, |
31 | | - // this must be disabled because the output of some tests include NBSP characters |
32 | | - 'non_printable_character' => false, |
33 | | - 'blank_line_between_import_groups' => false, |
34 | | - 'no_trailing_comma_in_singleline' => false, |
35 | | - 'nullable_type_declaration_for_default_null_value' => true, |
36 | | - 'phpdoc_to_comment' => false, |
| 32 | + 'native_constant_invocation' => ['strict' => false], |
| 33 | + 'header_comment' => ['header' => $fileHeaderComment], |
| 34 | + 'modernize_strpos' => true, |
| 35 | + 'get_class_to_class_keyword' => true, |
37 | 36 | ]) |
| 37 | + ->setRiskyAllowed(true) |
| 38 | + ->setFinder( |
| 39 | + (new PhpCsFixer\Finder()) |
| 40 | + ->in(__DIR__.'/src') |
| 41 | + ->append([__FILE__]) |
| 42 | + ) |
| 43 | + ->setCacheFile('.php-cs-fixer.cache') |
38 | 44 | ; |
0 commit comments