Skip to content

Commit 7cc27f9

Browse files
committed
fixes after rebase
1 parent 7ffed15 commit 7cc27f9

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/Analyser/MutatingScope.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3684,7 +3684,7 @@ public function addTypeToExpression(Expr $expr, Type $type): self
36843684

36853685
public function removeTypeFromExpression(Expr $expr, Type $typeToRemove): self
36863686
{
3687-
if ($typeToRemove instanceof NeverType) {
3687+
if ($typeToRemove->isNever()->yes()) {
36883688
return $this;
36893689
}
36903690

src/Analyser/NodeScopeResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4396,7 +4396,7 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context, $sto
43964396
$isExhaustive = $hasDefaultCond || $hasAlwaysTrueCond;
43974397
if (!$isExhaustive) {
43984398
$remainingType = $matchScope->getType($expr->cond);
4399-
if ($remainingType->isNever()->no()) {
4399+
if ($remainingType->isNever()->yes()) {
44004400
$isExhaustive = true;
44014401
}
44024402
}
@@ -7675,7 +7675,7 @@ private function scopeHasNeverVariable(MutatingScope $scope, array $varNames): b
76757675
{
76767676
foreach ($varNames as $varName) {
76777677
$type = $scope->getVariableType($varName);
7678-
if ($type instanceof NeverType) {
7678+
if ($type->isNever()->yes()) {
76797679
return true;
76807680
}
76817681
}

src/Type/Generic/GenericClassStringType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ public function tryRemove(Type $typeToRemove): ?Type
226226
$classReflection = $reflectionProvider->getClass($typeToRemove->getValue());
227227
if ($classReflection->isFinal()) {
228228
$remainingType = TypeCombinator::remove($generic, $objectTypeToRemove);
229-
if ($remainingType instanceof NeverType) {
229+
if ($remainingType->isNever()->yes()) {
230230
return new NeverType();
231231
}
232232

src/Type/TypehintHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public static function decideType(
122122
if (
123123
($type->isCallable()->yes() && $phpDocType->isCallable()->yes())
124124
|| (
125-
(!$phpDocType->isNever()->yes() || ($type instanceof MixedType && !$type->isExplicitMixed()))
125+
($phpDocType->isNever()->no() || ($type instanceof MixedType && !$type->isExplicitMixed()))
126126
&& $type->isSuperTypeOf(TemplateTypeHelper::resolveToBounds($phpDocType))->yes()
127127
)
128128
) {

0 commit comments

Comments
 (0)