65c1b5fb75
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
30 lines
743 B
PHP
30 lines
743 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace KTXC\Application\Execution;
|
|
|
|
final readonly class ExecutionContext
|
|
{
|
|
public function __construct(
|
|
public RuntimeType $runtime,
|
|
public string $executionId,
|
|
public string $correlationId,
|
|
public ?string $causationId = null,
|
|
public ?string $requestId = null,
|
|
public ?string $operationName = null,
|
|
public array $traceMetadata = [],
|
|
) {
|
|
}
|
|
|
|
public static function fromDescriptor(ExecutionDescriptor $descriptor): self
|
|
{
|
|
return new self(
|
|
$descriptor->runtime,
|
|
$descriptor->executionId,
|
|
$descriptor->correlationId,
|
|
operationName: $descriptor->operationName,
|
|
);
|
|
}
|
|
}
|