original_string: public function get_discussion_list_renderer(
          forum_entity $forum
      ) : discussion_list_renderer {
  
          $capabilitymanager = $this->managerfactory->get_capability_manager($forum);
          $rendererbase = $this->rendererbase;
          $notifications = [];
  
          switch ($forum->get_type()) {
              case 'news':
                  if (SITEID == $forum->get_course_id()) {
                      $template = 'mod_forum/frontpage_news_discussion_list';
                  } else {
                      $template = 'mod_forum/news_discussion_list';
                  }
                  break;
              case 'qanda':
                  $template = 'mod_forum/qanda_discussion_list';
                  break;
              default:
                  $template = 'mod_forum/discussion_list';
          }
  
          return new discussion_list_renderer(
              $forum,
              $rendererbase,
              $this->legacydatamapperfactory,
              $this->exporterfactory,
              $this->vaultfactory,
              $this->builderfactory,
              $capabilitymanager,
              $this->urlfactory,
              $template,
              $notifications,
              function($discussions, $user, $forum) {
  
                  $exporteddiscussionsummarybuilder = $this->builderfactory->get_exported_discussion_summaries_builder();
                  return $exporteddiscussionsummarybuilder->build(
                      $user,
                      $forum,
                      $discussions
                  );
              }
          );
      }
code: public function get_discussion_list_renderer(
          forum_entity $forum
      ) : discussion_list_renderer {
  
          $capabilitymanager = $this->managerfactory->get_capability_manager($forum);
          $rendererbase = $this->rendererbase;
          $notifications = [];
  
          switch ($forum->get_type()) {
              case 'news':
                  if (SITEID == $forum->get_course_id()) {
                      $template = 'mod_forum/frontpage_news_discussion_list';
                  } else {
                      $template = 'mod_forum/news_discussion_list';
                  }
                  break;
              case 'qanda':
                  $template = 'mod_forum/qanda_discussion_list';
                  break;
              default:
                  $template = 'mod_forum/discussion_list';
          }
  
          return new discussion_list_renderer(
              $forum,
              $rendererbase,
              $this->legacydatamapperfactory,
              $this->exporterfactory,
              $this->vaultfactory,
              $this->builderfactory,
              $capabilitymanager,
              $this->urlfactory,
              $template,
              $notifications,
              function($discussions, $user, $forum) {
  
                  $exporteddiscussionsummarybuilder = $this->builderfactory->get_exported_discussion_summaries_builder();
                  return $exporteddiscussionsummarybuilder->build(
                      $user,
                      $forum,
                      $discussions
                  );
              }
          );
      }
code_tokens: public function get_discussion_list_renderer ( forum_entity $ forum ) : discussion_list_renderer { $ capabilitymanager = $ this -> managerfactory -> get_capability_manager ( $ forum ) ; $ rendererbase = $ this -> rendererbase ; $ notifications = [ ] ; switch ( $ forum -> get_type ( ) ) { case 'news' : if ( SITEID == $ forum -> get_course_id ( ) ) { $ template = 'mod_forum/frontpage_news_discussion_list' ; } else { $ template = 'mod_forum/news_discussion_list' ; } break ; case 'qanda' : $ template = 'mod_forum/qanda_discussion_list' ; break ; default : $ template = 'mod_forum/discussion_list' ; } return new discussion_list_renderer ( $ forum , $ rendererbase , $ this -> legacydatamapperfactory , $ this -> exporterfactory , $ this -> vaultfactory , $ this -> builderfactory , $ capabilitymanager , $ this -> urlfactory , $ template , $ notifications , function ( $ discussions , $ user , $ forum ) { $ exporteddiscussionsummarybuilder = $ this -> builderfactory -> get_exported_discussion_summaries_builder ( ) ; return $ exporteddiscussionsummarybuilder -> build ( $ user , $ forum , $ discussions ) ; } ) ; }
docstring: Create a standard type discussion list renderer.
  
  @param forum_entity $forum The forum that the discussions belong to
  @return discussion_list_renderer
docstring_tokens: Create a standard type discussion list renderer .