Skip to content

Commit 81b8cc4

Browse files
committedJan 26, 2023
HasMethodType, HasPropertyType - missing CompoundType handling
1 parent ce65e05 commit 81b8cc4

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed
 

‎src/Type/Accessory/HasMethodType.php

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ private function getCanonicalMethodName(): string
5050

5151
public function accepts(Type $type, bool $strictTypes): TrinaryLogic
5252
{
53+
if ($type instanceof CompoundType) {
54+
return $type->isAcceptedBy($this, $strictTypes);
55+
}
56+
5357
return TrinaryLogic::createFromBoolean($this->equals($type));
5458
}
5559

‎src/Type/Accessory/HasPropertyType.php

+4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ public function getPropertyName(): string
5252

5353
public function accepts(Type $type, bool $strictTypes): TrinaryLogic
5454
{
55+
if ($type instanceof CompoundType) {
56+
return $type->isAcceptedBy($this, $strictTypes);
57+
}
58+
5559
return TrinaryLogic::createFromBoolean($this->equals($type));
5660
}
5761

0 commit comments

Comments
 (0)
Please sign in to comment.