Skip to content

Commit c442468

Browse files
committed
Fix assertInstanceOf handler
1 parent 23009eb commit c442468

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/Type/PHPUnit/Assert/AssertTypeSpecifyingExtensionHelper.php

+2-8
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,10 @@ private static function getExpressionResolvers(): array
123123
{
124124
if (self::$resolvers === null) {
125125
self::$resolvers = [
126-
'InstanceOf' => static function (Scope $scope, Arg $class, Arg $object): ?Instanceof_ {
127-
$classType = $scope->getType($class->value);
128-
$classNames = $classType->getConstantStrings();
129-
if (count($classNames) !== 1) {
130-
return null;
131-
}
132-
126+
'InstanceOf' => static function (Scope $scope, Arg $class, Arg $object): Instanceof_ {
133127
return new Instanceof_(
134128
$object->value,
135-
new Name($classNames[0]->getValue())
129+
$class->value
136130
);
137131
},
138132
'Same' => static function (Scope $scope, Arg $expected, Arg $actual): Identical {

0 commit comments

Comments
 (0)