Skip to content

Commit d3d6752

Browse files
authored
Fix PHPStorm inspection errors
1 parent 71e0520 commit d3d6752

5 files changed

Lines changed: 9 additions & 8 deletions

File tree

src/Analyser/NodeScopeResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1910,7 +1910,7 @@ private function processStmtNode(
19101910
continue;
19111911
}
19121912

1913-
foreach ($catchTypes as $catchTypeIndex => $catchTypeItem) {
1913+
foreach ($catchTypes as $catchTypeItem) {
19141914
if ($catchTypeItem->isSuperTypeOf($throwPoint->getType())->no()) {
19151915
continue;
19161916
}
@@ -6393,7 +6393,7 @@ private function processAssignVar(
63936393
$throwPoints = array_merge($throwPoints, $keyResult->getThrowPoints());
63946394
$impurePoints = array_merge($impurePoints, $keyResult->getImpurePoints());
63956395
$isAlwaysTerminating = $isAlwaysTerminating || $keyResult->isAlwaysTerminating();
6396-
$itemScope = $keyResult->getScope();
6396+
// no need for $keyResult->getScope()
63976397
}
63986398

63996399
if ($arrayItem->key === null) {

src/PhpDoc/StubValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function validate(array $stubFiles, bool $debug): array
133133
]);
134134

135135
$ruleRegistry = $this->getRuleRegistry($container);
136-
$collectorRegistry = $this->getCollectorRegistry($container);
136+
$collectorRegistry = $this->getCollectorRegistry();
137137

138138
$fileAnalyser = $container->getByType(FileAnalyser::class);
139139

@@ -293,7 +293,7 @@ private function getRuleRegistry(Container $container): RuleRegistry
293293
return new DirectRuleRegistry($rules);
294294
}
295295

296-
private function getCollectorRegistry(Container $container): CollectorRegistry
296+
private function getCollectorRegistry(): CollectorRegistry
297297
{
298298
return new CollectorRegistry([]);
299299
}

src/Rules/PhpDoc/WrongVariableNameInVarTagRule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function processNode(Node $node, Scope $scope): array
101101
}
102102

103103
if ($node instanceof Node\Stmt\Global_) {
104-
return $this->processGlobal($scope, $node, $varTags);
104+
return $this->processGlobal($node, $varTags);
105105
}
106106

107107
if ($node instanceof InClassNode || $node instanceof InClassMethodNode || $node instanceof InFunctionNode) {
@@ -372,7 +372,7 @@ private function processStmt(Scope $scope, array $varTags, ?Expr $defaultExpr):
372372
* @param VarTag[] $varTags
373373
* @return list<IdentifierRuleError>
374374
*/
375-
private function processGlobal(Scope $scope, Node\Stmt\Global_ $node, array $varTags): array
375+
private function processGlobal(Node\Stmt\Global_ $node, array $varTags): array
376376
{
377377
$variableNames = [];
378378
foreach ($node->vars as $var) {

src/Type/Php/StatDynamicReturnTypeExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use PHPStan\Type\Type;
1818
use PHPStan\Type\TypeCombinator;
1919
use SplFileObject;
20+
use function count;
2021
use function in_array;
2122

2223
#[AutowiredService]
@@ -68,7 +69,7 @@ private function getReturnType(): Type
6869
'blocks',
6970
];
7071

71-
foreach ($keys as $key) {
72+
for ($i = 0; $i < count($keys); $i++) {
7273
$builder->setOffsetValueType(null, $valueType);
7374
}
7475

tests/PHPStan/Rules/Methods/data/uppercase-string.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ public function test(
2828
$this->acceptUppercaseString($string);
2929
$this->acceptUppercaseString($uppercaseString);
3030
$this->acceptUppercaseString($numericString);
31-
$this->acceptUppercaseString($nonEmptyLowercaseString);
31+
$this->acceptUppercaseString($nonEmptyUppercaseString);
3232
}
3333
}

0 commit comments

Comments
 (0)