Skip to content

Commit e7c9605

Browse files
committed
Adding a break statement to improve the sample code
1 parent f64b5b5 commit e7c9605

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cookbook/security/impersonating_user.rst

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ impersonating user::
9999
foreach ($securityContext->getToken()->getRoles() as $role) {
100100
if ($role instanceof SwitchUserRole) {
101101
$impersonatingUser = $role->getSource()->getUser();
102+
break;
102103
}
103104
}
104105
}

0 commit comments

Comments
 (0)