original_string: protected function make_filter_object($filtername, $context, $localconfig) {
          global $CFG;
          $path = $CFG->dirroot .'/filter/'. $filtername .'/filter.php';
          if (!is_readable($path)) {
              return null;
          }
          include_once($path);
  
          $filterclassname = 'filter_' . $filtername;
          if (class_exists($filterclassname)) {
              return new $filterclassname($context, $localconfig);
          }
  
          return null;
      }
code: protected function make_filter_object($filtername, $context, $localconfig) {
          global $CFG;
          $path = $CFG->dirroot .'/filter/'. $filtername .'/filter.php';
          if (!is_readable($path)) {
              return null;
          }
          include_once($path);
  
          $filterclassname = 'filter_' . $filtername;
          if (class_exists($filterclassname)) {
              return new $filterclassname($context, $localconfig);
          }
  
          return null;
      }
code_tokens: protected function make_filter_object ( $ filtername , $ context , $ localconfig ) { global $ CFG ; $ path = $ CFG -> dirroot . '/filter/' . $ filtername . '/filter.php' ; if ( ! is_readable ( $ path ) ) { return null ; } include_once ( $ path ) ; $ filterclassname = 'filter_' . $ filtername ; if ( class_exists ( $ filterclassname ) ) { return new $ filterclassname ( $ context , $ localconfig ) ; } return null ; }
docstring: Factory method for creating a filter.
  
  @param string $filtername The filter name, for example 'tex'.
  @param context $context context object.
  @param array $localconfig array of local configuration variables for this filter.
  @return moodle_text_filter The filter, or null, if this type of filter is
  not recognised or could not be created.
docstring_tokens: Factory method for creating a filter .