original_string: public function get_password_change_info(stdClass $user) : array {
          $site = get_site();
          $systemcontext = context_system::instance();
  
          $data = new stdClass();
          $data->firstname = $user->firstname;
          $data->lastname  = $user->lastname;
          $data->username  = $user->username;
          $data->sitename  = format_string($site->fullname);
          $data->admin     = generate_email_signoff();
  
          if ($this->can_change_password() and $this->change_password_url()) {
              // We have some external url for password changing.
              $data->link = $this->change_password_url();
          } else {
              // No way to change password, sorry.
              $data->link = '';
          }
  
          if (!empty($data->link) and has_capability('moodle/user:changeownpassword', $systemcontext, $user->id)) {
              $subject = get_string('emailpasswordchangeinfosubject', '', format_string($site->fullname));
              $message = get_string('emailpasswordchangeinfo', '', $data);
          } else {
              $subject = get_string('emailpasswordchangeinfosubject', '', format_string($site->fullname));
              $message = get_string('emailpasswordchangeinfofail', '', $data);
          }
  
          return [
              'subject' => $subject,
              'message' => $message
          ];
      }
code: public function get_password_change_info(stdClass $user) : array {
          $site = get_site();
          $systemcontext = context_system::instance();
  
          $data = new stdClass();
          $data->firstname = $user->firstname;
          $data->lastname  = $user->lastname;
          $data->username  = $user->username;
          $data->sitename  = format_string($site->fullname);
          $data->admin     = generate_email_signoff();
  
          if ($this->can_change_password() and $this->change_password_url()) {
              // We have some external url for password changing.
              $data->link = $this->change_password_url();
          } else {
              // No way to change password, sorry.
              $data->link = '';
          }
  
          if (!empty($data->link) and has_capability('moodle/user:changeownpassword', $systemcontext, $user->id)) {
              $subject = get_string('emailpasswordchangeinfosubject', '', format_string($site->fullname));
              $message = get_string('emailpasswordchangeinfo', '', $data);
          } else {
              $subject = get_string('emailpasswordchangeinfosubject', '', format_string($site->fullname));
              $message = get_string('emailpasswordchangeinfofail', '', $data);
          }
  
          return [
              'subject' => $subject,
              'message' => $message
          ];
      }
code_tokens: public function get_password_change_info ( stdClass $ user ) : array { $ site = get_site ( ) ; $ systemcontext = context_system :: instance ( ) ; $ data = new stdClass ( ) ; $ data -> firstname = $ user -> firstname ; $ data -> lastname = $ user -> lastname ; $ data -> username = $ user -> username ; $ data -> sitename = format_string ( $ site -> fullname ) ; $ data -> admin = generate_email_signoff ( ) ; if ( $ this -> can_change_password ( ) and $ this -> change_password_url ( ) ) { // We have some external url for password changing. $ data -> link = $ this -> change_password_url ( ) ; } else { // No way to change password, sorry. $ data -> link = '' ; } if ( ! empty ( $ data -> link ) and has_capability ( 'moodle/user:changeownpassword' , $ systemcontext , $ user -> id ) ) { $ subject = get_string ( 'emailpasswordchangeinfosubject' , '' , format_string ( $ site -> fullname ) ) ; $ message = get_string ( 'emailpasswordchangeinfo' , '' , $ data ) ; } else { $ subject = get_string ( 'emailpasswordchangeinfosubject' , '' , format_string ( $ site -> fullname ) ) ; $ message = get_string ( 'emailpasswordchangeinfofail' , '' , $ data ) ; } return [ 'subject' => $ subject , 'message' => $ message ] ; }
docstring: Returns information on how the specified user can change their password.
  
  @param stdClass $user A user object
  @return string[] An array of strings with keys subject and message
docstring_tokens: Returns information on how the specified user can change their password .