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 17e9e9b commit 58287f6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/InnerList.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public function last(): ?Item

public function withParameters(Parameters $parameters): static
{
return ($this->parameters->toHttpValue() === $parameters->toHttpValue()) ? $this : new self($this->members, $parameters);
return $this->parameters->equals($parameters) ? $this : new self($this->members, $parameters);
}

/**
Expand Down Expand Up @@ -333,7 +333,7 @@ public function replace(
$member = self::filterMember($member);

return match (true) {
$member->toHttpValue() === $this->members[$offset]->toHttpValue() => $this,
$member->equals($this->members[$offset]) => $this,
default => new self(array_replace($this->members, [$offset => $member]), $this->parameters),
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,6 @@ public function withValue(

public function withParameters(Parameters $parameters): static
{
return $this->parameters->toHttpValue() === $parameters->toHttpValue() ? $this : new self($this->value, $parameters);
return $this->parameters->equals($parameters) ? $this : new self($this->value, $parameters);
}
}
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->toHttpValue() === $this->members[$offset]->toHttpValue() => $this,
$member->equals( $this->members[$offset]) => $this,
default => new self(...array_replace($this->members, [$offset => $member])),
};
}
Expand Down

0 comments on commit 58287f6

Please sign in to comment.