update rules
This commit is contained in:
parent
3c9679da8e
commit
3c81249b90
2 changed files with 12 additions and 9 deletions
|
@ -1,8 +1,8 @@
|
||||||
<?php declare(strict_types=1);
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
use PhpCsFixer\Fixer\Basic\BracesFixer;
|
|
||||||
use PhpCsFixer\Fixer\Import\OrderedImportsFixer;
|
use PhpCsFixer\Fixer\Import\OrderedImportsFixer;
|
||||||
use PhpCsFixer\Fixer\Operator\NewWithBracesFixer;
|
use PhpCsFixer\Fixer\LanguageConstruct\FunctionToConstantFixer;
|
||||||
|
use PhpCsFixer\Fixer\Operator\OperatorLinebreakFixer;
|
||||||
use PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer;
|
use PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer;
|
||||||
use PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer;
|
use PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer;
|
||||||
use PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer;
|
use PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer;
|
||||||
|
@ -24,8 +24,8 @@ use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
|
||||||
return static function (ECSConfig $c): void {
|
return static function (ECSConfig $c): void {
|
||||||
$c->skip([
|
$c->skip([
|
||||||
BlankLineAfterOpeningTagFixer::class,
|
BlankLineAfterOpeningTagFixer::class,
|
||||||
NewWithBracesFixer::class,
|
|
||||||
OrderedImportsFixer::class,
|
OrderedImportsFixer::class,
|
||||||
|
FunctionToConstantFixer::class,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$c->sets([
|
$c->sets([
|
||||||
|
@ -42,6 +42,13 @@ return static function (ECSConfig $c): void {
|
||||||
SetList::SYMPLIFY,
|
SetList::SYMPLIFY,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$c->dynamicSets([
|
||||||
|
'@PER-CS',
|
||||||
|
'@PER-CS:risky',
|
||||||
|
'@PHP83Migration',
|
||||||
|
'@PHP80Migration:risky',
|
||||||
|
]);
|
||||||
|
|
||||||
// force visibility declaration on class constants
|
// force visibility declaration on class constants
|
||||||
$c->ruleWithConfiguration(ClassConstantVisibilitySniff::class, [
|
$c->ruleWithConfiguration(ClassConstantVisibilitySniff::class, [
|
||||||
'fixable' => true,
|
'fixable' => true,
|
||||||
|
@ -53,9 +60,10 @@ return static function (ECSConfig $c): void {
|
||||||
DisallowGroupUseSniff::class,
|
DisallowGroupUseSniff::class,
|
||||||
MultipleUsesPerLineSniff::class,
|
MultipleUsesPerLineSniff::class,
|
||||||
NamespaceSpacingSniff::class,
|
NamespaceSpacingSniff::class,
|
||||||
|
OperatorLinebreakFixer::class,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// import all namespaces, and event php core functions and classes
|
// import all namespaces, and even php core functions and classes
|
||||||
$c->ruleWithConfiguration(
|
$c->ruleWithConfiguration(
|
||||||
ReferenceUsedNamesOnlySniff::class,
|
ReferenceUsedNamesOnlySniff::class,
|
||||||
[
|
[
|
||||||
|
@ -95,7 +103,6 @@ return static function (ECSConfig $c): void {
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Remove useless parentheses in new statements
|
// Remove useless parentheses in new statements
|
||||||
$c->rule(BracesFixer::class);
|
|
||||||
$c->rule(NewWithoutParenthesesSniff::class);
|
$c->rule(NewWithoutParenthesesSniff::class);
|
||||||
|
|
||||||
// do not inline short multilinestatements
|
// do not inline short multilinestatements
|
||||||
|
|
|
@ -14,7 +14,6 @@ use Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector;
|
||||||
use Rector\CodingStyle\Rector\Closure\StaticClosureRector;
|
use Rector\CodingStyle\Rector\Closure\StaticClosureRector;
|
||||||
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
|
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
|
||||||
use Rector\CodingStyle\Rector\If_\NullableCompareToNullRector;
|
use Rector\CodingStyle\Rector\If_\NullableCompareToNullRector;
|
||||||
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
|
|
||||||
use Rector\Config\RectorConfig;
|
use Rector\Config\RectorConfig;
|
||||||
use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector;
|
use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector;
|
||||||
use Rector\EarlyReturn\Rector\If_\ChangeAndIfToEarlyReturnRector;
|
use Rector\EarlyReturn\Rector\If_\ChangeAndIfToEarlyReturnRector;
|
||||||
|
@ -44,7 +43,6 @@ use Rector\TypeDeclaration\Rector\FunctionLike\AddParamTypeSplFixedArrayRector;
|
||||||
use Rector\TypeDeclaration\Rector\FunctionLike\AddReturnTypeDeclarationFromYieldsRector;
|
use Rector\TypeDeclaration\Rector\FunctionLike\AddReturnTypeDeclarationFromYieldsRector;
|
||||||
use Rector\TypeDeclaration\Rector\Param\ParamTypeFromStrictTypedPropertyRector;
|
use Rector\TypeDeclaration\Rector\Param\ParamTypeFromStrictTypedPropertyRector;
|
||||||
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector;
|
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector;
|
||||||
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictGetterMethodReturnTypeRector;
|
|
||||||
|
|
||||||
return static function (RectorConfig $c): void {
|
return static function (RectorConfig $c): void {
|
||||||
$c->sets([LevelSetList::UP_TO_PHP_82]);
|
$c->sets([LevelSetList::UP_TO_PHP_82]);
|
||||||
|
@ -65,7 +63,6 @@ return static function (RectorConfig $c): void {
|
||||||
ExplicitBoolCompareRector::class,
|
ExplicitBoolCompareRector::class,
|
||||||
InlineArrayReturnAssignRector::class,
|
InlineArrayReturnAssignRector::class,
|
||||||
InlineIsAInstanceOfRector::class,
|
InlineIsAInstanceOfRector::class,
|
||||||
NewlineAfterStatementRector::class,
|
|
||||||
NewlineBeforeNewAssignSetRector::class,
|
NewlineBeforeNewAssignSetRector::class,
|
||||||
NullableCompareToNullRector::class,
|
NullableCompareToNullRector::class,
|
||||||
ParamTypeByMethodCallTypeRector::class,
|
ParamTypeByMethodCallTypeRector::class,
|
||||||
|
@ -90,7 +87,6 @@ return static function (RectorConfig $c): void {
|
||||||
StaticClosureRector::class,
|
StaticClosureRector::class,
|
||||||
ThrowWithPreviousExceptionRector::class,
|
ThrowWithPreviousExceptionRector::class,
|
||||||
TypedPropertyFromStrictConstructorRector::class,
|
TypedPropertyFromStrictConstructorRector::class,
|
||||||
TypedPropertyFromStrictGetterMethodReturnTypeRector::class,
|
|
||||||
RemoveAlwaysElseRector::class,
|
RemoveAlwaysElseRector::class,
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue