original_string: public function add_userlist(userlist_base $userlist) : userlist_collection {
          $component = $userlist->get_component();
          if (isset($this->userlists[$component])) {
              throw new \moodle_exception("A userlist has already been added for the '{$component}' component");
          }
  
          $this->userlists[$component] = $userlist;
  
          return $this;
      }
code: public function add_userlist(userlist_base $userlist) : userlist_collection {
          $component = $userlist->get_component();
          if (isset($this->userlists[$component])) {
              throw new \moodle_exception("A userlist has already been added for the '{$component}' component");
          }
  
          $this->userlists[$component] = $userlist;
  
          return $this;
      }
code_tokens: public function add_userlist ( userlist_base $ userlist ) : userlist_collection { $ component = $ userlist -> get_component ( ) ; if ( isset ( $ this -> userlists [ $ component ] ) ) { throw new \ moodle_exception ( "A userlist has already been added for the '{$component}' component" ) ; } $ this -> userlists [ $ component ] = $ userlist ; return $ this ; }
docstring: Add a userlist to this collection.
  
  @param   userlist_base $userlist the userlist to export.
  @return  $this
docstring_tokens: Add a userlist to this collection .