Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ProtobufSerializer.php

function ProtobufSerializer::forTransport

@psalm-param TransportInterface<SUPPORTED_CONTENT_TYPES> $transport

3 calls to ProtobufSerializer::forTransport()
LogsExporter::__construct in vendor/open-telemetry/exporter-otlp/LogsExporter.php
@psalm-param TransportInterface<SUPPORTED_CONTENT_TYPES> $transport
MetricExporter::__construct in vendor/open-telemetry/exporter-otlp/MetricExporter.php
@psalm-param TransportInterface<SUPPORTED_CONTENT_TYPES> $transport
SpanExporter::__construct in vendor/open-telemetry/exporter-otlp/SpanExporter.php
@psalm-param TransportInterface<SUPPORTED_CONTENT_TYPES> $transport

File

vendor/open-telemetry/exporter-otlp/ProtobufSerializer.php, line 45

Class

ProtobufSerializer
@internal @psalm-type SUPPORTED_CONTENT_TYPES = ContentTypes::PROTOBUF|ContentTypes::JSON|ContentTypes::NDJSON

Namespace

OpenTelemetry\Contrib\Otlp

Code

public static function forTransport(TransportInterface $transport) : ProtobufSerializer {
    return match ($contentType = $transport->contentType()) {    ContentTypes::PROTOBUF, ContentTypes::JSON, ContentTypes::NDJSON => new self($contentType),
        default => throw new InvalidArgumentException(sprintf('Not supported content type "%s"', $contentType)),
    
    };
}
RSS feed
Powered by Drupal