Skip to content

Commit

Permalink
HasOffsetValueType - fix traverse
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Sep 7, 2022
1 parent b8f2d5d commit 5b448a7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Type/Accessory/HasOffsetValueType.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,12 @@ public function toArray(): Type

public function traverse(callable $cb): Type
{
return $this;
$newValueType = $cb($this->valueType);
if ($newValueType === $this->valueType) {
return $this;
}

return new self($this->offsetType, $newValueType);
}

public static function __set_state(array $properties): Type
Expand Down

0 comments on commit 5b448a7

Please # to comment.