original_string: public function get_category_formatted_description($coursecat, $options = null) {
          if ($coursecat->id && $coursecat->is_uservisible() && !empty($coursecat->description)) {
              if (!isset($coursecat->descriptionformat)) {
                  $descriptionformat = FORMAT_MOODLE;
              } else {
                  $descriptionformat = $coursecat->descriptionformat;
              }
              if ($options === null) {
                  $options = array('noclean' => true, 'overflowdiv' => true);
              } else {
                  $options = (array)$options;
              }
              $context = context_coursecat::instance($coursecat->id);
              if (!isset($options['context'])) {
                  $options['context'] = $context;
              }
              $text = file_rewrite_pluginfile_urls($coursecat->description,
                      'pluginfile.php', $context->id, 'coursecat', 'description', null);
              return format_text($text, $descriptionformat, $options);
          }
          return null;
      }
code: public function get_category_formatted_description($coursecat, $options = null) {
          if ($coursecat->id && $coursecat->is_uservisible() && !empty($coursecat->description)) {
              if (!isset($coursecat->descriptionformat)) {
                  $descriptionformat = FORMAT_MOODLE;
              } else {
                  $descriptionformat = $coursecat->descriptionformat;
              }
              if ($options === null) {
                  $options = array('noclean' => true, 'overflowdiv' => true);
              } else {
                  $options = (array)$options;
              }
              $context = context_coursecat::instance($coursecat->id);
              if (!isset($options['context'])) {
                  $options['context'] = $context;
              }
              $text = file_rewrite_pluginfile_urls($coursecat->description,
                      'pluginfile.php', $context->id, 'coursecat', 'description', null);
              return format_text($text, $descriptionformat, $options);
          }
          return null;
      }
code_tokens: public function get_category_formatted_description ( $ coursecat , $ options = null ) { if ( $ coursecat -> id && $ coursecat -> is_uservisible ( ) && ! empty ( $ coursecat -> description ) ) { if ( ! isset ( $ coursecat -> descriptionformat ) ) { $ descriptionformat = FORMAT_MOODLE ; } else { $ descriptionformat = $ coursecat -> descriptionformat ; } if ( $ options === null ) { $ options = array ( 'noclean' => true , 'overflowdiv' => true ) ; } else { $ options = ( array ) $ options ; } $ context = context_coursecat :: instance ( $ coursecat -> id ) ; if ( ! isset ( $ options [ 'context' ] ) ) { $ options [ 'context' ] = $ context ; } $ text = file_rewrite_pluginfile_urls ( $ coursecat -> description , 'pluginfile.php' , $ context -> id , 'coursecat' , 'description' , null ) ; return format_text ( $ text , $ descriptionformat , $ options ) ; } return null ; }
docstring: Returns formatted and filtered description of the given category
  
  @param core_course_category $coursecat category
  @param stdClass|array $options format options, by default [noclean,overflowdiv],
  if context is not specified it will be added automatically
  @return string|null
docstring_tokens: Returns formatted and filtered description of the given category