/** * Calls the TypedValueFormatter passed to the constructor. * * @param DataValue $value * @param string|null $dataTypeId * * @throws FormattingException * @return string Either plain text, wikitext or HTML, depending on the ValueFormatter * provided. */ private function formatValue(DataValue $value, $dataTypeId = null) { if (!$this->isUnDeserializableValue($value)) { if ($this->valueFormatter instanceof TypedValueFormatter) { $text = $this->valueFormatter->formatValue($value, $dataTypeId); } else { $text = $this->valueFormatter->format($value); } } else { $text = ''; } return $text; }