Skip to content

Commit 178b31a

Browse files
committed
non-nullable temporality
1 parent 6ae0ffb commit 178b31a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/SDK/Metrics/MetricMetadataInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function description(): ?string;
2222
/**
2323
* Returns the underlying temporality of this metric.
2424
*
25-
* @return ?Temporality internal temporality
25+
* @return Temporality internal temporality
2626
*/
27-
public function temporality(): ?Temporality;
27+
public function temporality(): Temporality;
2828
}

tests/Unit/Contrib/Otlp/MetricExporterFactoryTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function test_create_with_temporality(array $env, ?Temporality $expected)
5858

5959
$this->assertInstanceOf(AggregationTemporalitySelectorInterface::class, $exporter);
6060
$metric = $this->createMock(MetricMetadataInterface::class);
61-
$metric->method('temporality')->willReturn(null);
61+
$metric->method('temporality')->willReturn(Temporality::DELTA);
6262
$this->assertSame($expected, $exporter->temporality($metric));
6363
}
6464

@@ -85,11 +85,11 @@ public static function temporalityProvider(): array
8585
[
8686
'OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE' => 'lowmemory',
8787
],
88-
null,
88+
Temporality::DELTA,
8989
],
9090
'CuMuLaTiVe (mixed case)' => [
9191
[
92-
'OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE' => 'cumulative',
92+
'OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE' => 'CuMuLaTiVe',
9393
],
9494
Temporality::CUMULATIVE,
9595
],

0 commit comments

Comments
 (0)