type = $type; $this->spanContext = $spanContext; } /** * @param string $type * @param Span $span * @return Reference when context is invalid * @throws InvalidReferenceArgumentException on empty type */ public static function createForSpan(string $type, Span $span): Reference { return new self($type, $span->getContext()); } /** * @return SpanContext */ public function getSpanContext(): SpanContext { return $this->spanContext; } /** * Checks whether a Reference is of one type. * * @param string $type the type for the reference * @return bool */ public function isType(string $type): bool { return $this->type === $type; } }