src/SDK/Trace/ExporterFactory.php
/**
      * Returns the corresponding Exporter via the configuration string
      *
      * @param string $configurationString String containing unextracted information for Exporter creation
      * Should follow the format: contribType+baseUrl?option1=a
      * Query string is optional and based on the Exporter
      */
Returns the corresponding Exporter via the configuration string
@param string $configurationString String containing unextracted information for Exporter creation
Should follow the format: contribType+baseUrl?option1=a
Query string is optional and based on the Exporter
Returns the corresponding Exporter via the configuration string @param string $configurationString String containing unextracted information for Exporter creation Should follow the format : contribType + baseUrl?option1 = a Query string is optional and based on the Exporter
public function fromConnectionString(string $configurationString): SpanExporterInterface
    {
        $strArr = explode('+', $configurationString);
        if (sizeof($strArr) !== 2) {
            throw new InvalidArgumentException('Invalid format.');
        }
        $contribName = strtolower($strArr[0]);
        $endpointUrl = $strArr[1];
        if (!$this->isAllowed($contribName)) {
            throw new InvalidArgumentException('Invalid contrib name.');
        }
        $dsn = empty($endpointUrl) ? '' : DsnParser::parse($endpointUrl);
        $endpointUrl = $this->parseBaseUrl($dsn);
        $args = empty($dsn) ? [] : $dsn->getParameters();
        $scheme = empty($dsn) ? '' : $dsn->getScheme();
        switch ($contribName) {
            case 'jaeger':
                return JaegerExporter::fromConnectionString($endpointUrl, $this->name);
            case 'zipkin':
                return ZipkinExporter::fromConnectionString($endpointUrl, $this->name);
            case 'newrelic':
                return NewrelicExporter::fromConnectionString($endpointUrl, $this->name, $args['licenseKey'] ?? null);
            case 'otlp':
                switch ($scheme) {
                case 'grpc':
                    return OtlpGrpcExporter::fromConnectionString($endpointUrl);
                case 'http':
                    return OtlpHttpExporter::fromConnectionString($endpointUrl);
                default:
                    throw new InvalidArgumentException('Invalid otlp scheme');
                }
            case 'zipkintonewrelic':
                return ZipkinToNewrelicExporter::fromConnectionString($endpointUrl, $this->name, $args['licenseKey'] ?? null);
            case 'console':
                return ConsoleSpanExporter::fromConnectionString($endpointUrl);
            default:
                throw new InvalidArgumentException('Invalid contrib name.');
        }
    }
public function fromConnectionString ( string $ configurationString ) : SpanExporterInterface { $ strArr = explode ( '+' , $ configurationString ) ; if ( sizeof ( $ strArr ) !== 2 ) { throw new InvalidArgumentException ( 'Invalid format.' ) ; } $ contribName = strtolower ( $ strArr [ 0 ] ) ; $ endpointUrl = $ strArr [ 1 ] ; if ( ! $ this -> isAllowed ( $ contribName ) ) { throw new InvalidArgumentException ( 'Invalid contrib name.' ) ; } $ dsn = empty ( $ endpointUrl ) ? '' : DsnParser :: parse ( $ endpointUrl ) ; $ endpointUrl = $ this -> parseBaseUrl ( $ dsn ) ; $ args = empty ( $ dsn ) ? [ ] : $ dsn -> getParameters ( ) ; $ scheme = empty ( $ dsn ) ? '' : $ dsn -> getScheme ( ) ; switch ( $ contribName ) { case 'jaeger' : return JaegerExporter :: fromConnectionString ( $ endpointUrl , $ this -> name ) ; case 'zipkin' : return ZipkinExporter :: fromConnectionString ( $ endpointUrl , $ this -> name ) ; case 'newrelic' : return NewrelicExporter :: fromConnectionString ( $ endpointUrl , $ this -> name , $ args [ 'licenseKey' ] ?? null ) ; case 'otlp' : switch ( $ scheme ) { case 'grpc' : return OtlpGrpcExporter :: fromConnectionString ( $ endpointUrl ) ; case 'http' : return OtlpHttpExporter :: fromConnectionString ( $ endpointUrl ) ; default : throw new InvalidArgumentException ( 'Invalid otlp scheme' ) ; } case 'zipkintonewrelic' : return ZipkinToNewrelicExporter :: fromConnectionString ( $ endpointUrl , $ this -> name , $ args [ 'licenseKey' ] ?? null ) ; case 'console' : return ConsoleSpanExporter :: fromConnectionString ( $ endpointUrl ) ; default : throw new InvalidArgumentException ( 'Invalid contrib name.' ) ; } }
Returns the corresponding Exporter via the configuration string
 @param string $configurationString String containing unextracted information for Exporter creation
 Should follow the format: contribType+baseUrl?option1=a
 Query string is optional and based on the Exporter
Returns the corresponding Exporter via the configuration string @param string $configurationString String containing unextracted information for Exporter creation Should follow the format : contribType + baseUrl?option1 = a Query string is optional and based on the Exporter
// checks if input is given with the format type+baseUrl // @phan-suppress-next-line PhanUndeclaredClassMethod // parameters are only retrieved if there was an endpoint given // no break