Skip to content

Commit

Permalink
Merge pull request #1 from PhantPHP/Fix-beginsWithVowel
Browse files Browse the repository at this point in the history
Fix beginsWithVowel
  • Loading branch information
lennyrouanet authored Feb 20, 2024
2 parents 36ea9e8 + aa6e1c2 commit c81bfbd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions component/Handler/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ public function beginsWithVowel(): bool
{
$string = $this->value;
$string = ltrim($string);
$firstLetter = strtolower($string[0]);
$firstLetter = (string) (new self($firstLetter))->removeAccents();
$string = (string) (new self($string))->removeAccents();
$firstLetter = substr($string, 0, 1);
$firstLetter = strtolower($firstLetter);

return in_array($firstLetter, ['a','e','i','o','u','y']);
}
Expand Down

0 comments on commit c81bfbd

Please sign in to comment.