diff --git a/src/Analyser/TypeSpecifier.php b/src/Analyser/TypeSpecifier.php index 1383c3a47ec..a00d81026e7 100644 --- a/src/Analyser/TypeSpecifier.php +++ b/src/Analyser/TypeSpecifier.php @@ -360,7 +360,7 @@ public function specifyTypesInCondition( ); } - return $this->create( + return $this->create( $exprNode->getArgs()[0]->value, TypeCombinator::union($objectType, $classStringType), $context, diff --git a/tests/PHPStan/Analyser/NodeScopeResolverTest.php b/tests/PHPStan/Analyser/NodeScopeResolverTest.php index 173bec93eb6..59a0e236c5c 100644 --- a/tests/PHPStan/Analyser/NodeScopeResolverTest.php +++ b/tests/PHPStan/Analyser/NodeScopeResolverTest.php @@ -1042,8 +1042,6 @@ public function dataFileAsserts(): iterable yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-7963-three.php'); yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-8017.php'); yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-8004.php'); - - require_once __DIR__ . '/data/bug-5552.php'; yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-5552.php'); }