Skip to content

Commit f04fd0c

Browse files
Remove condition
1 parent fa22c84 commit f04fd0c

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/Type/Php/GetClassDynamicReturnTypeExtension.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use PHPStan\Type\Generic\GenericClassStringType;
1515
use PHPStan\Type\Generic\TemplateType;
1616
use PHPStan\Type\IntersectionType;
17-
use PHPStan\Type\ObjectShapeType;
1817
use PHPStan\Type\ObjectType;
1918
use PHPStan\Type\ObjectWithoutClassType;
2019
use PHPStan\Type\StaticType;
@@ -67,10 +66,6 @@ static function (Type $type, callable $traverse): Type {
6766
return new GenericClassStringType(new ObjectType($type->getClassName()));
6867
}
6968

70-
if ($type instanceof ObjectShapeType) {
71-
return new ClassStringType();
72-
}
73-
7469
$isObject = $type->isObject();
7570
if ($isObject->no()) {
7671
return new ConstantBooleanType(false);

tests/PHPStan/Analyser/nsrt/bug-4890.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ public function updateProp(object $entity): void
4646
*/
4747
public function updateObjectShape($entity): void
4848
{
49-
assertType('class-string', get_class($entity));
49+
assertType('class-string<object{foo: Bug4890\HelloWorld, bar: int, baz?: string}>', get_class($entity));
5050
assert(property_exists($entity, 'foo'));
51-
assertType('class-string', get_class($entity));
51+
assertType('class-string<object{foo: Bug4890\HelloWorld, bar: int, baz?: string}>', get_class($entity));
5252
}
5353
}

0 commit comments

Comments
 (0)