Skip to content

Commit c81bfbd

Browse files
authored
Merge pull request #1 from PhantPHP/Fix-beginsWithVowel
Fix beginsWithVowel
2 parents 36ea9e8 + aa6e1c2 commit c81bfbd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

component/Handler/Text.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,9 @@ public function beginsWithVowel(): bool
130130
{
131131
$string = $this->value;
132132
$string = ltrim($string);
133-
$firstLetter = strtolower($string[0]);
134-
$firstLetter = (string) (new self($firstLetter))->removeAccents();
133+
$string = (string) (new self($string))->removeAccents();
134+
$firstLetter = substr($string, 0, 1);
135+
$firstLetter = strtolower($firstLetter);
135136

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

0 commit comments

Comments
 (0)