original_string: private function getRoles(UserInterface $user, TokenInterface $token)
      {
          $roles = $user->getRoles();
  
          foreach ($token->getRoles(false) as $role) {
              if ($role instanceof SwitchUserRole) {
                  $roles[] = $role;
  
                  break;
              }
          }
  
          return $roles;
      }
code: private function getRoles(UserInterface $user, TokenInterface $token)
      {
          $roles = $user->getRoles();
  
          foreach ($token->getRoles(false) as $role) {
              if ($role instanceof SwitchUserRole) {
                  $roles[] = $role;
  
                  break;
              }
          }
  
          return $roles;
      }
code_tokens: private function getRoles ( UserInterface $ user , TokenInterface $ token ) { $ roles = $ user -> getRoles ( ) ; foreach ( $ token -> getRoles ( false ) as $ role ) { if ( $ role instanceof SwitchUserRole ) { $ roles [ ] = $ role ; break ; } } return $ roles ; }
docstring: Retrieves roles from user and appends SwitchUserRole if original token contained one.
  
  @return array The user roles
docstring_tokens: Retrieves roles from user and appends SwitchUserRole if original token contained one .