Skip to content

Commit c89cf99

Browse files
committed
refactor: Update roleOrPermission array mapping to ensure string return type
1 parent 30d9030 commit c89cf99

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Middleware/RoleOrPermissionMiddleware.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ protected static function parseRoleOrPermissionToString(array|string|\BackedEnum
6565
}
6666

6767
if (is_array($roleOrPermission)) {
68-
$roleOrPermission = array_map(fn ($r) => $r instanceof \BackedEnum ? $r->value : $r, $roleOrPermission);
68+
$roleOrPermission = array_map(function ($r): string {
69+
return $r instanceof \BackedEnum ? $r->value : (string) $r;
70+
}, $roleOrPermission);
6971

7072
return implode('|', $roleOrPermission);
7173
}

0 commit comments

Comments
 (0)