original_string: protected static function transform_user_competency($userid, $uc, competency $competency, performance_helper $helper) {
          $data = [
              'proficient' => static::transform_proficiency($uc->get('proficiency')),
              'rating' => static::transform_competency_grade($competency, $uc->get('grade'), $helper),
              'timemodified' => $uc->get('timemodified') ? transform::datetime($uc->get('timemodified')) : '-',
              'timecreated' => $uc->get('timecreated') ? transform::datetime($uc->get('timecreated')) : '-',
              'created_or_modified_by_you' => transform::yesno($uc->get('usermodified') == $userid),
          ];
  
          if ($uc instanceof user_competency) {
              $reviewer = $uc->get('reviewerid');
              $data['status'] = (string) user_competency::get_status_name($uc->get('status'));
              $data['reviewerid'] = $reviewer ? transform::user($reviewer) : '-';
              $data['reviewer_is_you'] = transform::yesno($reviewer == $userid);
          }
  
          return $data;
      }
code: protected static function transform_user_competency($userid, $uc, competency $competency, performance_helper $helper) {
          $data = [
              'proficient' => static::transform_proficiency($uc->get('proficiency')),
              'rating' => static::transform_competency_grade($competency, $uc->get('grade'), $helper),
              'timemodified' => $uc->get('timemodified') ? transform::datetime($uc->get('timemodified')) : '-',
              'timecreated' => $uc->get('timecreated') ? transform::datetime($uc->get('timecreated')) : '-',
              'created_or_modified_by_you' => transform::yesno($uc->get('usermodified') == $userid),
          ];
  
          if ($uc instanceof user_competency) {
              $reviewer = $uc->get('reviewerid');
              $data['status'] = (string) user_competency::get_status_name($uc->get('status'));
              $data['reviewerid'] = $reviewer ? transform::user($reviewer) : '-';
              $data['reviewer_is_you'] = transform::yesno($reviewer == $userid);
          }
  
          return $data;
      }
code_tokens: protected static function transform_user_competency ( $ userid , $ uc , competency $ competency , performance_helper $ helper ) { $ data = [ 'proficient' => static :: transform_proficiency ( $ uc -> get ( 'proficiency' ) ) , 'rating' => static :: transform_competency_grade ( $ competency , $ uc -> get ( 'grade' ) , $ helper ) , 'timemodified' => $ uc -> get ( 'timemodified' ) ? transform :: datetime ( $ uc -> get ( 'timemodified' ) ) : '-' , 'timecreated' => $ uc -> get ( 'timecreated' ) ? transform :: datetime ( $ uc -> get ( 'timecreated' ) ) : '-' , 'created_or_modified_by_you' => transform :: yesno ( $ uc -> get ( 'usermodified' ) == $ userid ) , ] ; if ( $ uc instanceof user_competency ) { $ reviewer = $ uc -> get ( 'reviewerid' ) ; $ data [ 'status' ] = ( string ) user_competency :: get_status_name ( $ uc -> get ( 'status' ) ) ; $ data [ 'reviewerid' ] = $ reviewer ? transform :: user ( $ reviewer ) : '-' ; $ data [ 'reviewer_is_you' ] = transform :: yesno ( $ reviewer == $ userid ) ; } return $ data ; }
docstring: Transform user competency.
  
  @param int $userid The user ID we are exporting for.
  @param user_competency|user_competency_plan|user_competency_course $uc The user competency.
  @param competency $competency The associated competency.
  @param performance_helper $helper The performance helper.
  @return array
docstring_tokens: Transform user competency .