original_string: final protected function get_format_parameters($property) {
          $parameters = [
              'component' => null,
              'filearea' => null,
              'itemid' => null,
              'options' => [],
              'striplinks' => true,
          ];
  
          $candidate = 'get_format_parameters_for_' . $property;
          if (method_exists($this, $candidate)) {
              $parameters = array_merge($parameters, $this->{$candidate}());
          }
  
          if (!isset($parameters['context'])) {
              if (!isset($this->related['context']) || !($this->related['context'] instanceof context)) {
                  throw new coding_exception("Unknown context to use for formatting the property '$property' in the " .
                      "exporter '" . get_class($this) . "'. You either need to add 'context' to your related objects, " .
                      "or create the method '$candidate' and return the context from there.");
              }
              $parameters['context'] = $this->related['context'];
  
          } else if (!($parameters['context'] instanceof context)) {
              throw new coding_exception("The context given to format the property '$property' in the exporter '" .
                  get_class($this) . "' is invalid.");
          }
  
          return $parameters;
      }
code: final protected function get_format_parameters($property) {
          $parameters = [
              'component' => null,
              'filearea' => null,
              'itemid' => null,
              'options' => [],
              'striplinks' => true,
          ];
  
          $candidate = 'get_format_parameters_for_' . $property;
          if (method_exists($this, $candidate)) {
              $parameters = array_merge($parameters, $this->{$candidate}());
          }
  
          if (!isset($parameters['context'])) {
              if (!isset($this->related['context']) || !($this->related['context'] instanceof context)) {
                  throw new coding_exception("Unknown context to use for formatting the property '$property' in the " .
                      "exporter '" . get_class($this) . "'. You either need to add 'context' to your related objects, " .
                      "or create the method '$candidate' and return the context from there.");
              }
              $parameters['context'] = $this->related['context'];
  
          } else if (!($parameters['context'] instanceof context)) {
              throw new coding_exception("The context given to format the property '$property' in the exporter '" .
                  get_class($this) . "' is invalid.");
          }
  
          return $parameters;
      }
code_tokens: final protected function get_format_parameters ( $ property ) { $ parameters = [ 'component' => null , 'filearea' => null , 'itemid' => null , 'options' => [ ] , 'striplinks' => true , ] ; $ candidate = 'get_format_parameters_for_' . $ property ; if ( method_exists ( $ this , $ candidate ) ) { $ parameters = array_merge ( $ parameters , $ this -> { $ candidate } ( ) ) ; } if ( ! isset ( $ parameters [ 'context' ] ) ) { if ( ! isset ( $ this -> related [ 'context' ] ) || ! ( $ this -> related [ 'context' ] instanceof context ) ) { throw new coding_exception ( "Unknown context to use for formatting the property '$property' in the " . "exporter '" . get_class ( $ this ) . "'. You either need to add 'context' to your related objects, " . "or create the method '$candidate' and return the context from there." ) ; } $ parameters [ 'context' ] = $ this -> related [ 'context' ] ; } else if ( ! ( $ parameters [ 'context' ] instanceof context ) ) { throw new coding_exception ( "The context given to format the property '$property' in the exporter '" . get_class ( $ this ) . "' is invalid." ) ; } return $ parameters ; }
docstring: Get the format parameters.
  
  This method returns the parameters to use with the functions external_format_text(), and
  external_format_string(). To override the default parameters, you can define a protected method
  called 'get_format_parameters_for_<propertyName>'. For example, 'get_format_parameters_for_description',
  if your property is 'description'.
  
  Your method must return an array containing any of the following keys:
  - context: The context to use. Defaults to $this->related['context'] if defined, else throws an exception.
  - component: The component to use with external_format_text(). Defaults to null.
  - filearea: The filearea to use with external_format_text(). Defaults to null.
  - itemid: The itemid to use with external_format_text(). Defaults to null.
  - options: An array of options accepted by external_format_text() or external_format_string(). Defaults to [].
  - striplinks: Whether to strip the links with external_format_string(). Defaults to true.
  
  @param string $property The property to get the parameters for.
  @return array
docstring_tokens: Get the format parameters .