diff --git a/src/Analyser/TypeSpecifier.php b/src/Analyser/TypeSpecifier.php index ebc025d4640..ee7b805c01e 100644 --- a/src/Analyser/TypeSpecifier.php +++ b/src/Analyser/TypeSpecifier.php @@ -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()); @@ -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, + ); + } }