Skip to content

Commit 27666b9

Browse files
committed
Get rid of some technical debt
1 parent 36e412f commit 27666b9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

phpstan-baseline.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ parameters:
8686

8787
-
8888
message: "#^Doing instanceof PHPStan\\\\Type\\\\Constant\\\\ConstantStringType is error\\-prone and deprecated\\. Use Type\\:\\:getConstantStrings\\(\\) instead\\.$#"
89-
count: 5
89+
count: 2
9090
path: src/Analyser/TypeSpecifier.php
9191

9292
-

src/Analyser/TypeSpecifier.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ public function specifyTypesInCondition(
369369
&& $exprNode->name instanceof Name
370370
&& strtolower($exprNode->name->toString()) === 'gettype'
371371
&& isset($exprNode->getArgs()[0])
372-
&& $constantType instanceof ConstantStringType
372+
&& $constantType->isString()->yes()
373373
) {
374374
return $this->specifyTypesInCondition($scope, new Expr\BinaryOp\Identical($expr->left, $expr->right), $context, $rootExpr);
375375
}
@@ -379,7 +379,7 @@ public function specifyTypesInCondition(
379379
&& $exprNode->name instanceof Name
380380
&& strtolower($exprNode->name->toString()) === 'get_class'
381381
&& isset($exprNode->getArgs()[0])
382-
&& $constantType instanceof ConstantStringType
382+
&& $constantType->isString()->yes()
383383
) {
384384
return $this->specifyTypesInCondition($scope, new Expr\BinaryOp\Identical($expr->left, $expr->right), $context, $rootExpr);
385385
}

0 commit comments

Comments
 (0)