original_string: public static function roleLabel($role = null)
      {
          switch ($role) {
              case User::ROLE_ADMIN:
                  $label = 'danger';
                  $name = ArrayHelper::getValue(User::getRoles(), $role);
                  break;
              case User::ROLE_MODERATOR:
                  $label = 'info';
                  $name = ArrayHelper::getValue(User::getRoles(), $role);
                  break;
              default:
                  $label = 'warning';
                  $name = ArrayHelper::getValue(User::getRoles(), User::ROLE_MEMBER);
          }
  
          return Html::tag('span', $name, ['class' => 'label label-' . $label]);
      }
code: public static function roleLabel($role = null)
      {
          switch ($role) {
              case User::ROLE_ADMIN:
                  $label = 'danger';
                  $name = ArrayHelper::getValue(User::getRoles(), $role);
                  break;
              case User::ROLE_MODERATOR:
                  $label = 'info';
                  $name = ArrayHelper::getValue(User::getRoles(), $role);
                  break;
              default:
                  $label = 'warning';
                  $name = ArrayHelper::getValue(User::getRoles(), User::ROLE_MEMBER);
          }
  
          return Html::tag('span', $name, ['class' => 'label label-' . $label]);
      }
code_tokens: public static function roleLabel ( $ role = null ) { switch ( $ role ) { case User :: ROLE_ADMIN : $ label = 'danger' ; $ name = ArrayHelper :: getValue ( User :: getRoles ( ) , $ role ) ; break ; case User :: ROLE_MODERATOR : $ label = 'info' ; $ name = ArrayHelper :: getValue ( User :: getRoles ( ) , $ role ) ; break ; default : $ label = 'warning' ; $ name = ArrayHelper :: getValue ( User :: getRoles ( ) , User :: ROLE_MEMBER ) ; } return Html :: tag ( 'span' , $ name , [ 'class' => 'label label-' . $ label ] ) ; }
docstring: Returns role label HTML.
  @param int|null $role role ID
  @return string
docstring_tokens: Returns role label HTML .