Skip to content

Commit 89bc1e6

Browse files
committed
Fixes
1 parent 03bef7e commit 89bc1e6

File tree

8 files changed

+13
-19
lines changed

8 files changed

+13
-19
lines changed

src/Analyser/MutatingScope.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
use PhpParser\Node\InterpolatedStringPart;
2525
use PhpParser\Node\Name;
2626
use PhpParser\Node\Name\FullyQualified;
27-
use PhpParser\Node\Scalar\DNumber;
28-
use PhpParser\Node\Scalar\LNumber;
2927
use PhpParser\Node\Scalar\String_;
3028
use PhpParser\NodeFinder;
3129
use PHPStan\Node\ExecutionEndNode;
@@ -1125,7 +1123,7 @@ private function resolveType(string $exprString, Expr $node): Type
11251123
return $this->getType($node->expr);
11261124
}
11271125

1128-
if ($node instanceof LNumber) {
1126+
if ($node instanceof Node\Scalar\Int_) {
11291127
return $this->initializerExprTypeResolver->getType($node, InitializerExprContext::fromScope($this));
11301128
} elseif ($node instanceof String_) {
11311129
return $this->initializerExprTypeResolver->getType($node, InitializerExprContext::fromScope($this));
@@ -1149,7 +1147,7 @@ private function resolveType(string $exprString, Expr $node): Type
11491147
}
11501148

11511149
return $resultType ?? new ConstantStringType('');
1152-
} elseif ($node instanceof DNumber) {
1150+
} elseif ($node instanceof Node\Scalar\Float_) {
11531151
return $this->initializerExprTypeResolver->getType($node, InitializerExprContext::fromScope($this));
11541152
} elseif ($node instanceof Expr\CallLike && $node->isFirstClassCallable()) {
11551153
if ($node instanceof FuncCall) {
@@ -1707,10 +1705,10 @@ static function (Node $node, Scope $scope) use ($arrowScope, &$arrowFunctionImpu
17071705
}
17081706

17091707
if ($node instanceof Expr\PreInc) {
1710-
return $this->getType(new BinaryOp\Plus($node->var, new LNumber(1)));
1708+
return $this->getType(new BinaryOp\Plus($node->var, new Node\Scalar\Int_(1)));
17111709
}
17121710

1713-
return $this->getType(new BinaryOp\Minus($node->var, new LNumber(1)));
1711+
return $this->getType(new BinaryOp\Minus($node->var, new Node\Scalar\Int_(1)));
17141712
} elseif ($node instanceof Expr\Yield_) {
17151713
$functionReflection = $this->getFunction();
17161714
if ($functionReflection === null) {

src/Analyser/NodeScopeResolver.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,6 @@ private function processStmtNode(
444444
&& !$stmt instanceof Foreach_
445445
&& !$stmt instanceof Node\Stmt\Global_
446446
&& !$stmt instanceof Node\Stmt\Property
447-
&& !$stmt instanceof Node\Stmt\PropertyProperty
448447
&& !$stmt instanceof Node\Stmt\ClassConst
449448
&& !$stmt instanceof Node\Stmt\Const_
450449
) {

src/Dependency/ExportedNodeResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ private function exportClassStatement(Node\Stmt $node, string $fileName, string
336336
$docComment = $node->getDocComment();
337337

338338
return new ExportedPropertiesNode(
339-
array_map(static fn (Node\Stmt\PropertyProperty $prop): string => $prop->name->toString(), $node->props),
339+
array_map(static fn (Node\PropertyItem $prop): string => $prop->name->toString(), $node->props),
340340
$this->exportPhpDocNode(
341341
$fileName,
342342
$namespacedName,

src/Reflection/InitializerExprTypeResolver.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
use PhpParser\Node\Expr\PropertyFetch;
1212
use PhpParser\Node\Identifier;
1313
use PhpParser\Node\Name;
14-
use PhpParser\Node\Scalar\DNumber;
15-
use PhpParser\Node\Scalar\LNumber;
14+
use PhpParser\Node\Scalar\Float_;
15+
use PhpParser\Node\Scalar\Int_;
1616
use PhpParser\Node\Scalar\MagicConst;
1717
use PhpParser\Node\Scalar\MagicConst\Dir;
1818
use PhpParser\Node\Scalar\MagicConst\File;
@@ -113,10 +113,10 @@ public function getType(Expr $expr, InitializerExprContext $context): Type
113113
if ($expr instanceof TypeExpr) {
114114
return $expr->getExprType();
115115
}
116-
if ($expr instanceof LNumber) {
116+
if ($expr instanceof Int_) {
117117
return new ConstantIntegerType($expr->value);
118118
}
119-
if ($expr instanceof DNumber) {
119+
if ($expr instanceof Float_) {
120120
return new ConstantFloatType($expr->value);
121121
}
122122
if ($expr instanceof String_) {

src/Rules/Namespaces/ExistingNamesInUseRule.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function processNode(Node $node, Scope $scope): array
5858
}
5959

6060
/**
61-
* @param Node\Stmt\UseUse[] $uses
61+
* @param Node\UseItem[] $uses
6262
* @return list<IdentifierRuleError>
6363
*/
6464
private function checkConstants(array $uses): array
@@ -80,7 +80,7 @@ private function checkConstants(array $uses): array
8080
}
8181

8282
/**
83-
* @param Node\Stmt\UseUse[] $uses
83+
* @param Node\UseItem[] $uses
8484
* @return list<IdentifierRuleError>
8585
*/
8686
private function checkFunctions(array $uses): array
@@ -117,13 +117,13 @@ private function checkFunctions(array $uses): array
117117
}
118118

119119
/**
120-
* @param Node\Stmt\UseUse[] $uses
120+
* @param Node\UseItem[] $uses
121121
* @return list<IdentifierRuleError>
122122
*/
123123
private function checkClasses(array $uses): array
124124
{
125125
return $this->classCheck->checkClassNames(
126-
array_map(static fn (Node\Stmt\UseUse $use): ClassNameNodePair => new ClassNameNodePair((string) $use->name, $use->name), $uses),
126+
array_map(static fn (Node\UseItem $use): ClassNameNodePair => new ClassNameNodePair((string) $use->name, $use->name), $uses),
127127
);
128128
}
129129

src/Rules/PhpDoc/InvalidPhpDocVarTagTypeRule.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ public function processNode(Node $node, Scope $scope): array
4848
{
4949
if (
5050
$node instanceof Node\Stmt\Property
51-
|| $node instanceof Node\Stmt\PropertyProperty
5251
|| $node instanceof Node\Stmt\ClassConst
5352
|| $node instanceof Node\Stmt\Const_
5453
) {

src/Rules/PhpDoc/WrongVariableNameInVarTagRule.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public function processNode(Node $node, Scope $scope): array
5151
{
5252
if (
5353
$node instanceof Node\Stmt\Property
54-
|| $node instanceof Node\Stmt\PropertyProperty
5554
|| $node instanceof Node\Stmt\ClassConst
5655
|| $node instanceof Node\Stmt\Const_
5756
|| ($node instanceof VirtualNode && !$node instanceof InFunctionNode && !$node instanceof InClassMethodNode && !$node instanceof InClassNode)

src/Type/FileTypeMapper.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,6 @@ function (Node $node) use ($fileName, $lookForTrait, $phpDocNodeMap, &$traitFoun
520520
&& !$node instanceof Node\Stmt\Namespace_
521521
&& !$node instanceof Node\Stmt\Declare_
522522
&& !$node instanceof Node\Stmt\Use_
523-
&& !$node instanceof Node\Stmt\UseUse
524523
&& !$node instanceof Node\Stmt\GroupUse
525524
&& !$node instanceof Node\Stmt\TraitUse
526525
&& !$node instanceof Node\Stmt\TraitUseAdaptation

0 commit comments

Comments
 (0)