original_string: public function bootstrapRoleLabelFunction(UserInterface $user = null, array $roleColors = [], array $roleTrans = []) {
  
          if (null === $user) {
              return "";
          }
  
          $output = [];
  
          foreach ($user->getRoles() as $current) {
  
              $role = true === $current instanceof Role ? $current->getRole() : $current;
  
              $trans = $role;
              if (true === array_key_exists($role, $roleTrans)) {
                  $trans = $this->getTranslator()->trans($roleTrans[$role]);
              }
  
              $label = $this->getLabelTwigExtension()->bootstrapLabelDefaultFunction(["content" => $trans]);
              if (true === array_key_exists($role, $roleColors)) {
                  $label = $this->applyColor($label, $trans, $roleColors[$role]);
              }
  
              $output[] = $label;
          }
  
          return implode(" ", $output);
      }
code: public function bootstrapRoleLabelFunction(UserInterface $user = null, array $roleColors = [], array $roleTrans = []) {
  
          if (null === $user) {
              return "";
          }
  
          $output = [];
  
          foreach ($user->getRoles() as $current) {
  
              $role = true === $current instanceof Role ? $current->getRole() : $current;
  
              $trans = $role;
              if (true === array_key_exists($role, $roleTrans)) {
                  $trans = $this->getTranslator()->trans($roleTrans[$role]);
              }
  
              $label = $this->getLabelTwigExtension()->bootstrapLabelDefaultFunction(["content" => $trans]);
              if (true === array_key_exists($role, $roleColors)) {
                  $label = $this->applyColor($label, $trans, $roleColors[$role]);
              }
  
              $output[] = $label;
          }
  
          return implode(" ", $output);
      }
code_tokens: public function bootstrapRoleLabelFunction ( UserInterface $ user = null , array $ roleColors = [ ] , array $ roleTrans = [ ] ) { if ( null === $ user ) { return "" ; } $ output = [ ] ; foreach ( $ user -> getRoles ( ) as $ current ) { $ role = true === $ current instanceof Role ? $ current -> getRole ( ) : $ current ; $ trans = $ role ; if ( true === array_key_exists ( $ role , $ roleTrans ) ) { $ trans = $ this -> getTranslator ( ) -> trans ( $ roleTrans [ $ role ] ) ; } $ label = $ this -> getLabelTwigExtension ( ) -> bootstrapLabelDefaultFunction ( [ "content" => $ trans ] ) ; if ( true === array_key_exists ( $ role , $ roleColors ) ) { $ label = $ this -> applyColor ( $ label , $ trans , $ roleColors [ $ role ] ) ; } $ output [ ] = $ label ; } return implode ( " " , $ output ) ; }
docstring: Display a Bootstrap role label.
  
  @param UserInterface $user The user.
  @param array $roleColors The role colors.
  @param array $roleTrans The role translations.
  @return string Returns the Bootstrap role label.
docstring_tokens: Display a Bootstrap role label .