original_string: public static function course_created(\core\event\course_created $event) {
          global $CFG;
  
          $course = $event->get_record_snapshot('course', $event->objectid);
          $format = course_get_format($course);
          if ($format->supports_news() && !empty($course->newsitems)) {
              require_once($CFG->dirroot . '/mod/forum/lib.php');
              // Auto create the announcements forum.
              forum_get_course_forum($event->objectid, 'news');
          }
      }
code: public static function course_created(\core\event\course_created $event) {
          global $CFG;
  
          $course = $event->get_record_snapshot('course', $event->objectid);
          $format = course_get_format($course);
          if ($format->supports_news() && !empty($course->newsitems)) {
              require_once($CFG->dirroot . '/mod/forum/lib.php');
              // Auto create the announcements forum.
              forum_get_course_forum($event->objectid, 'news');
          }
      }
code_tokens: public static function course_created ( \ core \ event \ course_created $ event ) { global $ CFG ; $ course = $ event -> get_record_snapshot ( 'course' , $ event -> objectid ) ; $ format = course_get_format ( $ course ) ; if ( $ format -> supports_news ( ) && ! empty ( $ course -> newsitems ) ) { require_once ( $ CFG -> dirroot . '/mod/forum/lib.php' ) ; // Auto create the announcements forum. forum_get_course_forum ( $ event -> objectid , 'news' ) ; } }
docstring: Observer for \core\event\course_created event.
  
  @param \core\event\course_created $event
  @return void
docstring_tokens: Observer for \ core \ event \ course_created event .