Skip to content

Commit a293912

Browse files
committed
simplify
1 parent b68a40d commit a293912

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

‎src/Type/Constant/ConstantStringType.php‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
use PHPStan\Type\MixedType;
3535
use PHPStan\Type\NullType;
3636
use PHPStan\Type\ObjectType;
37-
use PHPStan\Type\ObjectWithoutClassType;
3837
use PHPStan\Type\StaticType;
3938
use PHPStan\Type\StringType;
4039
use PHPStan\Type\Traits\ConstantScalarTypeTrait;
@@ -152,9 +151,6 @@ public function isSuperTypeOf(Type $type): TrinaryLogic
152151
}
153152

154153
$genericType = $type->getGenericType();
155-
if ($genericType instanceof MixedType) {
156-
return TrinaryLogic::createMaybe();
157-
}
158154
if ($genericType instanceof StaticType) {
159155
$genericType = $genericType->getStaticObjectType();
160156
}

‎src/Type/Generic/GenericClassStringType.php‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use PHPStan\Type\CompoundType;
1313
use PHPStan\Type\Constant\ConstantStringType;
1414
use PHPStan\Type\IntersectionType;
15-
use PHPStan\Type\MixedType;
1615
use PHPStan\Type\NeverType;
1716
use PHPStan\Type\ObjectType;
1817
use PHPStan\Type\ObjectWithoutClassType;
@@ -92,11 +91,11 @@ public function isSuperTypeOf(Type $type): TrinaryLogic
9291
}
9392

9493
if ($type instanceof ConstantStringType) {
95-
$genericType = $this->type;
96-
if ($genericType instanceof MixedType) {
97-
return $type->isClassStringType();
94+
if ($type->isClassStringType()->no()) {
95+
return TrinaryLogic::createNo();
9896
}
9997

98+
$genericType = $this->type;
10099
if ($genericType instanceof StaticType) {
101100
$genericType = $genericType->getStaticObjectType();
102101
}

0 commit comments

Comments
 (0)