Skip to content

Commit

Permalink
Make Stringable::swap() match Str::swap() implementation (#40855)
Browse files Browse the repository at this point in the history
Both call function strtr().
  • Loading branch information
derekmd authored Feb 7, 2022
1 parent b04ab8a commit 277d590
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Support/Stringable.php
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ public function substrReplace($replace, $offset = 0, $length = null)
*/
public function swap(array $map)
{
return new static(str_replace(array_keys($map), array_values($map), $this->value));
return new static(strtr($this->value, $map));
}

/**
Expand Down

0 comments on commit 277d590

Please sign in to comment.