Skip to content

Commit 1bcddc7

Browse files
authored
[automated] Apply Coding Standard (#7169)
Co-authored-by: TomasVotruba <924196+TomasVotruba@users.noreply.github.com>
1 parent e95966d commit 1bcddc7

File tree

4 files changed

+24
-21
lines changed

4 files changed

+24
-21
lines changed

rules/CodeQuality/Rector/Class_/ConvertStaticToSelfRector.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
namespace Rector\CodeQuality\Rector\Class_;
66

7-
use PHPStan\Analyser\Scope;
8-
use PHPStan\Reflection\ClassConstantReflection;
97
use PhpParser\Node;
108
use PhpParser\Node\Expr\ClassConstFetch;
119
use PhpParser\Node\Expr\StaticCall;
1210
use PhpParser\Node\Expr\StaticPropertyFetch;
1311
use PhpParser\Node\Identifier;
1412
use PhpParser\Node\Name;
1513
use PhpParser\Node\Stmt\Class_;
14+
use PHPStan\Analyser\Scope;
15+
use PHPStan\Reflection\ClassConstantReflection;
1616
use PHPStan\Reflection\ClassReflection;
1717
use Rector\Configuration\Parameter\FeatureFlags;
1818
use Rector\Enum\ObjectReference;
@@ -165,7 +165,8 @@ private function shouldSkip(
165165
if (! $isFinal) {
166166
$memberIsFinal = $reflection instanceof ClassConstantReflection
167167
? $reflection->isFinal()
168-
: $reflection->isFinalByKeyword()->yes();
168+
: $reflection->isFinalByKeyword()
169+
->yes();
169170

170171
// Final native members can be safely converted
171172
if ($memberIsFinal) {

rules/Php85/Rector/Switch_/ColonAfterSwitchCaseRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function refactor(Node $node): ?Node
6666
}
6767

6868
if (count($case->stmts) === 0) {
69-
$startCaseStmtsPos = isset($node->cases[$key + 1])
69+
$startCaseStmtsPos = isset($node->cases[$key + 1])
7070
? $node->cases[$key + 1]->getStartTokenPos()
7171
: $node->getEndTokenPos();
7272
} else {

rules/Transform/Rector/FuncCall/WrapFuncCallWithPhpVersionIdCheckerRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private function isWrappedFuncCall(StmtsAwareInterface $stmtsAware): bool
132132
}
133133

134134
$phpVersionId = $this->getPhpVersionId($stmtsAware->cond);
135-
if (!$phpVersionId instanceof Int_) {
135+
if (! $phpVersionId instanceof Int_) {
136136
return false;
137137
}
138138

rules/TypeDeclaration/Rector/ClassMethod/AddReturnDocblockForScalarArrayFromAssignsRector.php

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,30 @@
55
namespace Rector\TypeDeclaration\Rector\ClassMethod;
66

77
use PhpParser\Node;
8-
use PHPStan\Type\Type;
98
use PhpParser\Node\Expr;
10-
use PHPStan\Type\ArrayType;
11-
use PHPStan\Type\FloatType;
12-
use PHPStan\Type\MixedType;
13-
use PHPStan\Type\StringType;
14-
use PHPStan\Type\IntegerType;
159
use PhpParser\Node\Expr\Array_;
10+
use PhpParser\Node\Expr\ArrayDimFetch;
1611
use PhpParser\Node\Expr\Assign;
17-
use PhpParser\Node\Scalar\Int_;
18-
use PhpParser\Node\Stmt\Return_;
1912
use PhpParser\Node\Expr\Variable;
20-
use Rector\Rector\AbstractRector;
2113
use PhpParser\Node\Scalar\DNumber;
14+
use PhpParser\Node\Scalar\Int_;
2215
use PhpParser\Node\Scalar\String_;
23-
use PhpParser\Node\Stmt\Function_;
2416
use PhpParser\Node\Stmt\ClassMethod;
25-
use PhpParser\Node\Expr\ArrayDimFetch;
17+
use PhpParser\Node\Stmt\Function_;
18+
use PhpParser\Node\Stmt\Return_;
19+
use PHPStan\Type\ArrayType;
20+
use PHPStan\Type\FloatType;
21+
use PHPStan\Type\IntegerType;
22+
use PHPStan\Type\MixedType;
23+
use PHPStan\Type\StringType;
24+
use PHPStan\Type\Type;
25+
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
26+
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTypeChanger;
2627
use Rector\PhpParser\Node\BetterNodeFinder;
28+
use Rector\Rector\AbstractRector;
2729
use Rector\TypeDeclaration\NodeAnalyzer\ReturnAnalyzer;
28-
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
29-
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
3030
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
31-
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTypeChanger;
31+
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
3232

3333
/**
3434
* @see \Rector\Tests\TypeDeclaration\Rector\ClassMethod\AddReturnDocblockForScalarArrayFromAssignsRector\AddReturnDocblockForScalarArrayFromAssignsRectorTest
@@ -123,7 +123,6 @@ public function refactor(Node $node): ?Node
123123

124124
$returnsScoped = $this->betterNodeFinder->findReturnsScoped($node);
125125

126-
127126
if (! $this->returnAnalyzer->hasOnlyReturnWithExpr($node, $returnsScoped)) {
128127
return null;
129128
}
@@ -191,7 +190,10 @@ private function resolveScalarArrayTypeForVariable(ClassMethod|Function_ $node,
191190
$arrayHasDimAssigns = false;
192191

193192
foreach ($assigns as $assign) {
194-
if ($assign->var instanceof Variable && $this->isName($assign->var, $variableName) && ($assign->expr instanceof Array_ && $assign->expr->items === [])) {
193+
if ($assign->var instanceof Variable && $this->isName(
194+
$assign->var,
195+
$variableName
196+
) && ($assign->expr instanceof Array_ && $assign->expr->items === [])) {
195197
$arrayHasInitialized = true;
196198
continue;
197199
}

0 commit comments

Comments
 (0)