Skip to content

Commit 5db0fd4

Browse files
loks0nclaude
andcommitted
Align Test adapter observe() to replace callback, matching OpenTelemetry adapter
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7cba673 commit 5db0fd4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Telemetry/Adapter/Test.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,11 @@ public function add(float|int $amount, iterable $attributes = []): void
137137
public function createObservableGauge(string $name, ?string $unit = null, ?string $description = null, array $advisory = []): ObservableGauge
138138
{
139139
$gauge = new class () extends ObservableGauge {
140-
/**
141-
* @var array<int, callable>
142-
*/
143-
public array $callbacks = [];
140+
public ?\Closure $callback = null;
144141

145142
public function observe(callable $callback): void
146143
{
147-
$this->callbacks[] = $callback;
144+
$this->callback = \Closure::fromCallable($callback);
148145
}
149146
};
150147
$this->observableGauges[$name] = $gauge;

0 commit comments

Comments
 (0)