original_string: public function registerFormWidget($className, $widgetInfo = null)
      {
          if (!is_array($widgetInfo)) {
              $widgetInfo = ['code' => $widgetInfo];
          }
  
          $widgetCode = $widgetInfo['code'] ?? null;
  
          if (!$widgetCode) {
              $widgetCode = Str::getClassId($className);
          }
  
          $this->formWidgets[$className] = $widgetInfo;
          $this->formWidgetHints[$widgetCode] = $className;
      }
code: public function registerFormWidget($className, $widgetInfo = null)
      {
          if (!is_array($widgetInfo)) {
              $widgetInfo = ['code' => $widgetInfo];
          }
  
          $widgetCode = $widgetInfo['code'] ?? null;
  
          if (!$widgetCode) {
              $widgetCode = Str::getClassId($className);
          }
  
          $this->formWidgets[$className] = $widgetInfo;
          $this->formWidgetHints[$widgetCode] = $className;
      }
code_tokens: public function registerFormWidget ( $ className , $ widgetInfo = null ) { if ( ! is_array ( $ widgetInfo ) ) { $ widgetInfo = [ 'code' => $ widgetInfo ] ; } $ widgetCode = $ widgetInfo [ 'code' ] ?? null ; if ( ! $ widgetCode ) { $ widgetCode = Str :: getClassId ( $ className ) ; } $ this -> formWidgets [ $ className ] = $ widgetInfo ; $ this -> formWidgetHints [ $ widgetCode ] = $ className ; }
docstring: Registers a single form widget.
  @param string $className Widget class name.
  @param array $widgetInfo Registration information, can contain a `code` key.
  @return void
docstring_tokens: Registers a single form widget .