Skip to content

Commit 9f20f0b

Browse files
committed
Leverage the match expression
1 parent c965187 commit 9f20f0b

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

Notification/Notification.php

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -167,17 +167,12 @@ protected function getDefaultEmoji(): string
167167
return '';
168168
}
169169

170-
switch ($this->importance) {
171-
case self::IMPORTANCE_URGENT:
172-
return '🌩️';
173-
case self::IMPORTANCE_HIGH:
174-
return '🌧️';
175-
case self::IMPORTANCE_MEDIUM:
176-
return '🌦️';
177-
case self::IMPORTANCE_LOW:
178-
default:
179-
return '';
180-
}
170+
return match ($this->importance) {
171+
self::IMPORTANCE_URGENT => '🌩️',
172+
self::IMPORTANCE_HIGH => '🌧️',
173+
self::IMPORTANCE_MEDIUM => '🌦️',
174+
default => '',
175+
};
181176
}
182177

183178
private function computeExceptionAsString(\Throwable $exception): string

0 commit comments

Comments
 (0)