|
| 1 | +<?php |
| 2 | + |
| 3 | +/** @noinspection PhpDeprecationInspection */ |
| 4 | +/** @noinspection PhpUnhandledExceptionInspection */ |
| 5 | +declare(strict_types=1); |
| 6 | + |
| 7 | +/** |
| 8 | + * Copyright (c) 2019-2026 guanguans<[email protected]> |
| 9 | + * |
| 10 | + * For the full copyright and license information, please view |
| 11 | + * the LICENSE file that was distributed with this source code. |
| 12 | + * |
| 13 | + * @see https://github.com/guanguans/soar-php |
| 14 | + */ |
| 15 | + |
| 16 | +use PhpCsFixer\Fixer\Basic\BracesPositionFixer; |
| 17 | +use PhpCsFixer\Fixer\Basic\SingleLineEmptyBodyFixer; |
| 18 | +use PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer; |
| 19 | +use PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer; |
| 20 | +use PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer; |
| 21 | +use PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer; |
| 22 | +use PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer; |
| 23 | +use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer; |
| 24 | +use PhpCsFixer\Fixer\Operator\ConcatSpaceFixer; |
| 25 | +use PhpCsFixer\Fixer\Operator\NewWithBracesFixer; |
| 26 | +use PhpCsFixer\Fixer\Operator\NewWithParenthesesFixer; |
| 27 | +use PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer; |
| 28 | +use PhpCsFixer\Fixer\Operator\OperatorLinebreakFixer; |
| 29 | +use PhpCsFixer\Fixer\Phpdoc\PhpdocLineSpanFixer; |
| 30 | +use PhpCsFixer\Fixer\StringNotation\ExplicitStringVariableFixer; |
| 31 | +use PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer; |
| 32 | +use PhpCsFixer\Fixer\Whitespace\ArrayIndentationFixer; |
| 33 | +use PhpCsFixer\Fixer\Whitespace\BlankLineBetweenImportGroupsFixer; |
| 34 | +use Symplify\CodingStandard\Fixer\ArrayNotation\ArrayListItemNewlineFixer; |
| 35 | +use Symplify\CodingStandard\Fixer\ArrayNotation\ArrayOpenerAndCloserNewlineFixer; |
| 36 | +use Symplify\CodingStandard\Fixer\Spacing\StandaloneLinePromotedPropertyFixer; |
| 37 | +use Symplify\EasyCodingStandard\Config\ECSConfig; |
| 38 | + |
| 39 | +return ECSConfig::configure() |
| 40 | + ->withPaths([ |
| 41 | + __DIR__.'/src/', |
| 42 | + __DIR__.'/tests/', |
| 43 | + __DIR__.'/.changelog', |
| 44 | + __DIR__.'/composer-bump', |
| 45 | + ]) |
| 46 | + ->withRootFiles() |
| 47 | + ->withSkip([ |
| 48 | + '*/Fixtures/*', |
| 49 | + __DIR__.'/_ide_helper.php', |
| 50 | + __DIR__.'/tests.php', |
| 51 | + BracesPositionFixer::class, |
| 52 | + SingleLineEmptyBodyFixer::class, |
| 53 | + ClassAttributesSeparationFixer::class, |
| 54 | + ClassDefinitionFixer::class, |
| 55 | + TrailingCommaInMultilineFixer::class, |
| 56 | + YodaStyleFixer::class, |
| 57 | + FunctionDeclarationFixer::class, |
| 58 | + ConcatSpaceFixer::class, |
| 59 | + NewWithBracesFixer::class, |
| 60 | + NewWithParenthesesFixer::class, |
| 61 | + NotOperatorWithSuccessorSpaceFixer::class, |
| 62 | + OperatorLinebreakFixer::class, |
| 63 | + PhpdocLineSpanFixer::class, |
| 64 | + ExplicitStringVariableFixer::class, |
| 65 | + SingleQuoteFixer::class, |
| 66 | + ArrayIndentationFixer::class, |
| 67 | + BlankLineBetweenImportGroupsFixer::class, |
| 68 | + ArrayListItemNewlineFixer::class, |
| 69 | + ArrayOpenerAndCloserNewlineFixer::class, |
| 70 | + StandaloneLinePromotedPropertyFixer::class, |
| 71 | + ]) |
| 72 | + ->withCache(__DIR__.'/.build/ecs/') |
| 73 | + ->withEditorConfig() |
| 74 | + // ->withoutParallel() |
| 75 | + ->withParallel() |
| 76 | + ->withPhpCsFixerSets( |
| 77 | + auto: true, |
| 78 | + autoRisky: true, |
| 79 | + autoPHPMigration: true, |
| 80 | + autoPHPMigrationRisky: true, |
| 81 | + autoPHPUnitMigrationRisky: true, |
| 82 | + ) |
| 83 | + ->withPreparedSets( |
| 84 | + psr12: true, |
| 85 | + common: true, |
| 86 | + ) |
| 87 | + // ->withConfiguredRule() |
| 88 | + ->withRules([ |
| 89 | + NoUnusedImportsFixer::class, |
| 90 | + ]); |
0 commit comments