/** * @param ReferenceValue $reference * @param string|null $context * @param Exception|null $previous */ public function __construct(ReferenceValue $reference, $context = null, Exception $previous = null) { $this->reference = $reference; $this->context = $context; if (null === $context) { $message = sprintf("Unable to resolve reference %s.", var_export($reference->uri()->toString(), true)); } else { $message = sprintf("Unable to resolve reference %s from within context %s.", var_export($reference->uri()->toString(), true), var_export($context, true)); } parent::__construct($message, 0, $previous); }
/** * @param Value\ReferenceValue $reference * * @return Value\PlaceholderValue * @throws Exception\UndefinedReferenceException */ public function visitReferenceValue(Value\ReferenceValue $reference) { $referenceUri = $this->uriResolver()->resolve($reference->uri(), $this->currentBaseUri()); $resolution = $this->resolution($referenceUri); if (null !== $resolution) { return $resolution; } $resolution = $this->startResolution($referenceUri); if (!($value = $this->resolveInline($referenceUri, $reference))) { $value = $this->resolveExternal($referenceUri, $reference); } $this->completeResolution($referenceUri, $value); return $resolution; }