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

Breadcrumb

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

function StatusData::create

@psalm-param API\StatusCode::STATUS_* $code

1 call to StatusData::create()
Span::setStatus in vendor/open-telemetry/sdk/Trace/Span.php
@inheritDoc

File

vendor/open-telemetry/sdk/Trace/StatusData.php, line 23

Class

StatusData

Namespace

OpenTelemetry\SDK\Trace

Code

public static function create(string $code, ?string $description = null) : self {
    if (empty($description)) {
        switch ($code) {
            case API\StatusCode::STATUS_UNSET:
                return self::unset();
            case API\StatusCode::STATUS_ERROR:
                return self::error();
            case API\StatusCode::STATUS_OK:
                return self::ok();
        }
    }
    // Ignore description for non Error statuses.
    if (API\StatusCode::STATUS_ERROR !== $code) {
        $description = '';
    }
    return new self($code, $description);
    
    /** @phan-suppress-current-line PhanTypeMismatchArgumentNullable */
}
RSS feed
Powered by Drupal