Skip to content

Commit 72a9a94

Browse files
authored
for some reason generate() is called twice
when it happens, the initials get doubled up, so 4 letters instead of 2. this fixes the effect, but would be interested to know why generate() is called twice... my code is simply: ``` echo new LetterAvatar('Hello World'); ```
1 parent a874000 commit 72a9a94

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/LetterAvatar.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ public function generate()
116116
$words = $this->break_words($this->name);
117117

118118
$number_of_word = 1;
119+
$this->name_initials = '';
119120
foreach ($words as $word) {
120121

121122
if ($number_of_word > 2)

0 commit comments

Comments
 (0)