/**
  * @param TemplateFactory $templateFactory
  * @param SnakFormatter $snakFormatter
  * @param EntityIdFormatter $propertyIdFormatter
  *
  * @throws InvalidArgumentException
  */
 public function __construct(TemplateFactory $templateFactory, SnakFormatter $snakFormatter, EntityIdFormatter $propertyIdFormatter)
 {
     if ($snakFormatter->getFormat() !== SnakFormatter::FORMAT_HTML && $snakFormatter->getFormat() !== SnakFormatter::FORMAT_HTML_WIDGET) {
         throw new InvalidArgumentException('$snakFormatter is expected to return text/html, not ' . $snakFormatter->getFormat());
     }
     $this->snakFormatter = $snakFormatter;
     $this->propertyIdFormatter = $propertyIdFormatter;
     $this->templateFactory = $templateFactory;
 }
 /**
  * @param EntityIdFormatter $idFormatter Please note that the magic label substitution we apply
  *     on top of this only works in case this returns links without display text.
  * @param ValueFormatter $valueFormatter
  * @param SnakFormatter $snakFormatter
  * @param Language $language
  * @param EntityIdParser $idParser
  *
  * @throws InvalidArgumentException
  */
 public function __construct(EntityIdFormatter $idFormatter, ValueFormatter $valueFormatter, SnakFormatter $snakFormatter, Language $language, EntityIdParser $idParser)
 {
     if ($snakFormatter->getFormat() !== SnakFormatter::FORMAT_PLAIN) {
         throw new InvalidArgumentException('Expected $snakFormatter to procude text/plain output, not ' . $snakFormatter->getFormat());
     }
     $this->idFormatter = $idFormatter;
     $this->valueFormatter = $valueFormatter;
     $this->snakFormatter = $snakFormatter;
     $this->language = $language;
     $this->idParser = $idParser;
     $this->stringNormalizer = new StringNormalizer();
 }
 /**
  * @param EntityIdFormatter $propertyIdFormatter Formatter for IDs, must generate HTML.
  * @param SnakFormatter $snakDetailsFormatter detailed Formatter for Snaks, must generate HTML.
  * @param SnakFormatter $snakBreadCrumbFormatter terse Formatter for Snaks, must generate HTML.
  * @param string $languageCode
  *
  * @throws InvalidArgumentException
  */
 public function __construct(EntityIdFormatter $propertyIdFormatter, SnakFormatter $snakDetailsFormatter, SnakFormatter $snakBreadCrumbFormatter, $languageCode)
 {
     if ($snakDetailsFormatter->getFormat() !== SnakFormatter::FORMAT_HTML && $snakDetailsFormatter->getFormat() !== SnakFormatter::FORMAT_HTML_DIFF) {
         throw new InvalidArgumentException('Expected $snakDetailsFormatter to generate html, not ' . $snakDetailsFormatter->getFormat());
     }
     if ($snakBreadCrumbFormatter->getFormat() !== SnakFormatter::FORMAT_HTML && $snakBreadCrumbFormatter->getFormat() !== SnakFormatter::FORMAT_HTML_DIFF) {
         throw new InvalidArgumentException('Expected $snakBreadCrumbFormatter to generate html, not ' . $snakBreadCrumbFormatter->getFormat());
     }
     $this->propertyIdFormatter = $propertyIdFormatter;
     $this->snakDetailsFormatter = $snakDetailsFormatter;
     $this->snakBreadCrumbFormatter = $snakBreadCrumbFormatter;
     $this->languageCode = $languageCode;
 }
 /**
  * @see SnakFormatter::getFormat
  *
  * @return string One of the SnakFormatter::FORMAT_... constants.
  */
 public function getFormat()
 {
     return $this->snakFormatter->getFormat();
 }