original_string: private static function get_element_instance($element, $id) {
          if ($element !== 'purpose' && $element !== 'category') {
              throw new coding_exception('No other elements than purpose and category are allowed');
          }
  
          $classname = '\tool_dataprivacy\\' . $element;
          return new $classname($id);
      }
code: private static function get_element_instance($element, $id) {
          if ($element !== 'purpose' && $element !== 'category') {
              throw new coding_exception('No other elements than purpose and category are allowed');
          }
  
          $classname = '\tool_dataprivacy\\' . $element;
          return new $classname($id);
      }
code_tokens: private static function get_element_instance ( $ element , $ id ) { if ( $ element !== 'purpose' && $ element !== 'category' ) { throw new coding_exception ( 'No other elements than purpose and category are allowed' ) ; } $ classname = '\tool_dataprivacy\\' . $ element ; return new $ classname ( $ id ) ; }
docstring: Returns an instance of the provided element.
  
  @throws \coding_exception
  @param string $element The element name 'purpose' or 'category'
  @param int $id The element id
  @return \core\persistent
docstring_tokens: Returns an instance of the provided element .