Skip to content

Commit

Permalink
Use $this context 🔨
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-rubel committed Dec 2, 2022
1 parent 1ba2801 commit e830cf7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Collection/FullNameFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ public function format(): string
{
$words = str($this->name)->split('/\s/');

$name = $words->map(function (string $word) {
$this->name = $words->map(function (string $word) {
return str($word)->ucfirst();
})->join(' ');

return str($name)
return str($this->name)
->replaceMatches('/\p{C}+/u', '')
->squish()
->value();
Expand Down

0 comments on commit e830cf7

Please sign in to comment.