original_string: public function widgetRegistry(WidgetRegistry $instance = null, $widgets = [])
      {
          deprecationWarning('widgetRegistry is deprecated, use widgetLocator instead.');
  
          if ($instance) {
              $instance->add($widgets);
              $this->setWidgetLocator($instance);
          }
  
          return $this->getWidgetLocator();
      }
code: public function widgetRegistry(WidgetRegistry $instance = null, $widgets = [])
      {
          deprecationWarning('widgetRegistry is deprecated, use widgetLocator instead.');
  
          if ($instance) {
              $instance->add($widgets);
              $this->setWidgetLocator($instance);
          }
  
          return $this->getWidgetLocator();
      }
code_tokens: public function widgetRegistry ( WidgetRegistry $ instance = null , $ widgets = [ ] ) { deprecationWarning ( 'widgetRegistry is deprecated, use widgetLocator instead.' ) ; if ( $ instance ) { $ instance -> add ( $ widgets ) ; $ this -> setWidgetLocator ( $ instance ) ; } return $ this -> getWidgetLocator ( ) ; }
docstring: Set the widget registry the helper will use.
  
  @param \Cake\View\Widget\WidgetRegistry|null $instance The registry instance to set.
  @param array $widgets An array of widgets
  @return \Cake\View\Widget\WidgetRegistry
  @deprecated 3.6.0 Use FormHelper::widgetLocator() instead.
docstring_tokens: Set the widget registry the helper will use .