Skip to content

Commit 4508c9e

Browse files
committed
Nullable message id?
1 parent 325b17c commit 4508c9e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

TranslatorTrait.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ public function getLocale()
4343
*/
4444
public function trans($id, array $parameters = [], $domain = null, $locale = null)
4545
{
46-
$id = (string) $id;
46+
if ('' === $id = (string) $id) {
47+
return '';
48+
}
4749

4850
if (!isset($parameters['%count%']) || !is_numeric($parameters['%count%'])) {
4951
return strtr($id, $parameters);

0 commit comments

Comments
 (0)