Skip to content

Commit

Permalink
Simplify internal codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Nov 20, 2024
1 parent 58287f6 commit 877f798
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/OuterList.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ public function replace(
$member = self::filterMember($member);

return match (true) {
$member->equals( $this->members[$offset]) => $this,
$member->equals($this->members[$offset]) => $this,
default => new self(...array_replace($this->members, [$offset => $member])),
};
}
Expand Down
9 changes: 5 additions & 4 deletions src/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,11 @@ public function equals(mixed $value): bool
}

return match (true) {
($this->value instanceof Bytes || $this->value instanceof Token || $this->value instanceof DisplayString) && $this->value->equals($value),
$this->value instanceof DateTimeInterface && $value instanceof DateTimeInterface && $value == $this->value,
$value === $this->value => true,
default => false,
$this->value instanceof Bytes,
$this->value instanceof Token,
$this->value instanceof DisplayString => $this->value->equals($value),
$this->value instanceof DateTimeInterface && $value instanceof DateTimeInterface => $value == $this->value,
default => $value === $this->value,
};
}
}

0 comments on commit 877f798

Please sign in to comment.