update cs configuration

This commit is contained in:
TomasVotruba 2017-08-15 01:02:23 +02:00
parent c7932b01ae
commit 412c1f10b5
5 changed files with 5 additions and 24 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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);

View File

@ -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);

View File

@ -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);