Skip to content

Commit

Permalink
Fix assertInstanceOf handler
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed May 23, 2023
1 parent 23009eb commit c442468
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/Type/PHPUnit/Assert/AssertTypeSpecifyingExtensionHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,10 @@ private static function getExpressionResolvers(): array
{
if (self::$resolvers === null) {
self::$resolvers = [
'InstanceOf' => static function (Scope $scope, Arg $class, Arg $object): ?Instanceof_ {
$classType = $scope->getType($class->value);
$classNames = $classType->getConstantStrings();
if (count($classNames) !== 1) {
return null;
}

'InstanceOf' => static function (Scope $scope, Arg $class, Arg $object): Instanceof_ {
return new Instanceof_(
$object->value,
new Name($classNames[0]->getValue())
$class->value
);
},
'Same' => static function (Scope $scope, Arg $expected, Arg $actual): Identical {
Expand Down

0 comments on commit c442468

Please sign in to comment.