Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

A couple of PHP 8.2 fixes #288

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Trace/Propagator/BinaryFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function deserialize($bin)
*/
public function serialize(SpanContext $context)
{
$spanHex = str_pad($context->spanId(), 16, "0", STR_PAD_LEFT);
$spanHex = str_pad($context->spanId() ?? "", 16, "0", STR_PAD_LEFT);
$traceOptions = $context->enabled() ? self::OPTION_ENABLED : 0;
return pack("CCH*CH*CC", 0, 0, $context->traceId(), 1, $spanHex, 2, $traceOptions);
}
Expand Down
2 changes: 2 additions & 0 deletions src/Trace/SpanContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class SpanContext
*/
private $enabled;

private ?bool $fromHeader;

/**
* Creates a new SpanContext instance
*
Expand Down