Skip to content

Commit a84b644

Browse files
committed
Polish
#18717 Signed-off-by: Sergey Shliakhov <husband.sergey@gmail.com>
1 parent 3f23ace commit a84b644

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/private/Avatar/Avatar.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,11 @@ private function getAvatarText(): string {
9393
$displayName = $this->getDisplayName();
9494
if (empty($displayName) === true) {
9595
return '?';
96-
} else {
97-
$firstLetters = array_map(function ($namePart) {
98-
return mb_strtoupper(mb_substr($namePart, 0, 1), 'UTF-8');
99-
}, explode(' ', $displayName));
100-
return implode('', array_slice($firstLetters, 0, 2));
10196
}
97+
$firstTwoLetters = array_map(function ($namePart) {
98+
return mb_strtoupper(mb_substr($namePart, 0, 1), 'UTF-8');
99+
}, explode(' ', $displayName, 2));
100+
return implode('', $firstLetters);
102101
}
103102

104103
/**

0 commit comments

Comments
 (0)