original_string: public static function match_username_to_user($username, $issuer) {
          $params = [
              'issuerid' => $issuer->get('id'),
              'username' => $username
          ];
          $result = linked_login::get_record($params);
  
          if ($result) {
              $user = \core_user::get_user($result->get('userid'));
              if (!empty($user) && !$user->deleted) {
                  return $result;
              }
          }
          return false;
      }
code: public static function match_username_to_user($username, $issuer) {
          $params = [
              'issuerid' => $issuer->get('id'),
              'username' => $username
          ];
          $result = linked_login::get_record($params);
  
          if ($result) {
              $user = \core_user::get_user($result->get('userid'));
              if (!empty($user) && !$user->deleted) {
                  return $result;
              }
          }
          return false;
      }
code_tokens: public static function match_username_to_user ( $ username , $ issuer ) { $ params = [ 'issuerid' => $ issuer -> get ( 'id' ) , 'username' => $ username ] ; $ result = linked_login :: get_record ( $ params ) ; if ( $ result ) { $ user = \ core_user :: get_user ( $ result -> get ( 'userid' ) ) ; if ( ! empty ( $ user ) && ! $ user -> deleted ) { return $ result ; } } return false ; }
docstring: See if there is a match for this username and issuer in the linked_login table.
  
  @param string $username as returned from an oauth client.
  @param \core\oauth2\issuer $issuer
  @return stdClass User record if found.
docstring_tokens: See if there is a match for this username and issuer in the linked_login table .