Skip to content

Commit

Permalink
Update TypeSpecifier.php
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Jun 4, 2022
1 parent b570968 commit 6b5a2b6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Analyser/TypeSpecifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ public function specifyTypesInCondition(
&& strtolower((string) $exprNode->name) === 'get_parent_class'
&& isset($exprNode->getArgs()[0])
&& $constantType instanceof ConstantStringType
&& $constantType->getValue() !== ''
) {
$argType = $scope->getType($exprNode->getArgs()[0]->value);
$objectType = new ObjectType($constantType->getValue());
Expand All @@ -300,15 +301,14 @@ public function specifyTypesInCondition(
);
}

if ($argType instanceof MixedType) {
return $this->create(
$exprNode->getArgs()[0]->value,
TypeCombinator::union($objectType, $classStringType),
$context,
false,
$scope,
);
}
return $this->create(
$exprNode->getArgs()[0]->value,
TypeCombinator::union($objectType, $classStringType),
$context,
false,
$scope,
);

}
}

Expand Down

0 comments on commit 6b5a2b6

Please sign in to comment.