Skip to content

Commit f2c9aca

Browse files
Simplify
1 parent d8f11d9 commit f2c9aca

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

src/Type/Generic/TemplateTypeVariance.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,7 @@ public function isValidVariance(TemplateType $templateType, Type $a, Type $b): I
176176
}
177177

178178
if ($this->invariant()) {
179-
$result = $a->equals($b);
180-
if (!$result && $b instanceof TemplateType && $a->equals($b->getBound())) {
181-
$result = true;
182-
}
179+
$result = $a->equals($b) || ($b instanceof TemplateType && $a->equals($b->getBound()));
183180
$reasons = [];
184181
if (!$result) {
185182
if (

src/Type/ObjectType.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -625,10 +625,6 @@ public function isSuperTypeOf(Type $type): IsSuperTypeOfResult
625625

626626
public function equals(Type $type): bool
627627
{
628-
if (!$type instanceof self) {
629-
return false;
630-
}
631-
632628
if (get_class($this) !== get_class($type)) {
633629
return false;
634630
}

0 commit comments

Comments
 (0)