Skip to content

Commit 9dddbbf

Browse files
committed
📦 Better typing for priority queue extractions
1 parent abf079c commit 9dddbbf

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Context/Extractor/ContextExtractorChain.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ public function extract(): ?SpanContext
2525
{
2626
$queue = clone $this->queue;
2727
while (false === $queue->isEmpty()) {
28-
if (null !== ($context = $queue->extract()->extract())) {
28+
/** @var ContextExtractorInterface $extractor */
29+
$extractor = $queue->extract();
30+
$context = $extractor->extract();
31+
if (null !== $context) {
2932
return $context;
3033
}
3134
}

src/Debug/Extractor/DebugExtractorChain.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ public function getDebug(): string
2323
{
2424
$queue = clone $this->queue;
2525
while (false === $queue->isEmpty()) {
26-
if ('' !== ($debugId = $queue->extract()->getDebug())) {
26+
/** @var DebugExtractorInterface $extractor */
27+
$extractor = $queue->extract();
28+
$debugId = $extractor->getDebug();
29+
if ('' !== $debugId) {
2730
return $debugId;
2831
}
2932
}

0 commit comments

Comments
 (0)