Skip to content

Commit f23650b

Browse files
committed
fix: workaround for phpstan bug
1 parent 0d319a2 commit f23650b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rules/TypeDeclaration/NodeAnalyzer/StrictTypeSafetyChecker.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ private function isPropertyAssignSafe(Assign $assign): bool
197197

198198
private function isTypeSafeForStrictMode(Type $declaredType, Type $valueType): bool
199199
{
200+
// this is a workaround for a phpstan bug
201+
if ($valueType instanceof MixedType) {
202+
return $declaredType instanceof MixedType;
203+
}
204+
200205
return $declaredType->accepts($valueType, strictTypes: true)
201206
->yes();
202207
}

0 commit comments

Comments
 (0)