Skip to content

Commit 314d948

Browse files
style: fix method ordering in ChannelBatchSpanProcessor
Move ensureInitialized() after public methods per PHP-CS-Fixer ordered_class_elements rule. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent db2648a commit 314d948

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

src/SpanProcessor/ChannelBatchSpanProcessor.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,6 @@ public function __construct(
4949
) {
5050
}
5151

52-
private function ensureInitialized(): void
53-
{
54-
if ($this->initialized) {
55-
return;
56-
}
57-
58-
$this->initialized = true;
59-
$this->exportContext = Context::getCurrent();
60-
$this->channel = new Channel($this->channelCapacity);
61-
$this->startConsumer();
62-
$this->startFlushTimer();
63-
}
64-
6552
public function onStart(ReadWriteSpanInterface $span, ContextInterface $parentContext): void
6653
{
6754
}
@@ -116,6 +103,19 @@ public function shutdown(?CancellationInterface $cancellation = null): bool
116103
return $this->exporter->shutdown($cancellation);
117104
}
118105

106+
private function ensureInitialized(): void
107+
{
108+
if ($this->initialized) {
109+
return;
110+
}
111+
112+
$this->initialized = true;
113+
$this->exportContext = Context::getCurrent();
114+
$this->channel = new Channel($this->channelCapacity);
115+
$this->startConsumer();
116+
$this->startFlushTimer();
117+
}
118+
119119
private function pushBatch(): void
120120
{
121121
if ($this->batch === [] || $this->channel === null) {

0 commit comments

Comments
 (0)