mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-20 15:31:58 +02:00
update cs configuration
This commit is contained in:
parent
c7932b01ae
commit
412c1f10b5
@ -11,7 +11,6 @@ checkers:
|
||||
SlevomatCodingStandard\Sniffs\Namespaces\ReferenceUsedNamesOnlySniff:
|
||||
allowPartialUses: false
|
||||
allowFullyQualifiedNameForCollidingClasses: false
|
||||
allowFullyQualifiedGlobalClasses: true
|
||||
|
||||
# Metrics
|
||||
PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff:
|
||||
@ -21,34 +20,19 @@ checkers:
|
||||
PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\NestingLevelSniff:
|
||||
absoluteNestingLevel: 3
|
||||
|
||||
# WhiteSpace
|
||||
PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SuperfluousWhitespaceSniff:
|
||||
ignoreBlankLines: false
|
||||
|
||||
PhpCsFixer\Fixer\Operator\ConcatSpaceFixer:
|
||||
spacing: one
|
||||
|
||||
# new since PhpCsFixer 2.2-2.4
|
||||
PhpCsFixer\Fixer\LanguageConstruct\IsNullFixer:
|
||||
use_yoda_style: false
|
||||
|
||||
parameters:
|
||||
exclude_checkers:
|
||||
# Excluded from symfony-checkers.neon
|
||||
- PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer
|
||||
- PhpCsFixer\Fixer\Operator\NewWithBracesFixer
|
||||
- PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer
|
||||
- PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer
|
||||
|
||||
skip:
|
||||
SlevomatCodingStandard\Sniffs\TypeHints\TypeHintDeclarationSniff:
|
||||
- src/Contract/Rector/RectorInterface.php
|
||||
- *src/Rector/Contrib/Nette/*Rector.php
|
||||
- *src/NodeVisitor/Traverse/*Visitor.php
|
||||
Symplify\CodingStandard\Fixer\Php\ClassStringToClassConstantFixer:
|
||||
# class might not exist
|
||||
- src/Rector/Contrib/Nette/RemoveConfiguratorConstantsRector.php
|
||||
- src/Rector/Contrib/Nette/NetteObjectToSmartTraitRector.php
|
||||
|
||||
Symplify\CodingStandard\Sniffs\Debug\CommentedOutCodeSniff:
|
||||
# examples of code to be found
|
||||
- src/NodeVisitor/DependencyInjection/NamedServicesToConstructor/GetterToPropertyRector.php
|
||||
|
@ -8,8 +8,5 @@ interface RectorInterface
|
||||
{
|
||||
public function isCandidate(Node $node): bool;
|
||||
|
||||
/**
|
||||
* @param Node $node
|
||||
*/
|
||||
public function refactor($node): ?Node;
|
||||
public function refactor(Node $node): ?Node;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ final class InjectPropertyRector extends AbstractRector
|
||||
/**
|
||||
* @param Property $propertyNode
|
||||
*/
|
||||
public function refactor($propertyNode): Node
|
||||
public function refactor(Node $propertyNode): Node
|
||||
{
|
||||
$propertyDocBlock = $this->createDocBlockFromNode($propertyNode);
|
||||
$propertyNode = $this->removeInjectAnnotationFromProperty($propertyNode, $propertyDocBlock);
|
||||
|
@ -65,7 +65,7 @@ final class NetteObjectToSmartTraitRector extends AbstractRector
|
||||
/**
|
||||
* @param Class_ $classNode
|
||||
*/
|
||||
public function refactor($classNode): ?Node
|
||||
public function refactor(Node $classNode): ?Node
|
||||
{
|
||||
$traitUseNode = $this->createTraitUse('Nette\SmartObject');
|
||||
$this->statementGlue->addAsFirstTrait($classNode, $traitUseNode);
|
||||
|
@ -32,7 +32,7 @@ final class RemoveConfiguratorConstantsRector extends AbstractRector
|
||||
/**
|
||||
* @param ClassConstFetch $classConstFetchNode
|
||||
*/
|
||||
public function refactor($classConstFetchNode): ?Node
|
||||
public function refactor(Node $classConstFetchNode): ?Node
|
||||
{
|
||||
$constantName = (string) $classConstFetchNode->name;
|
||||
$string = strtolower($constantName);
|
||||
|
Loading…
x
Reference in New Issue
Block a user