3333class SpanConverterTest extends TestCase
3434{
3535 /**
36- * @psalm-suppress InvalidArgument
36+ * @psalm-suppress InvalidArgument,PossiblyNullReference
3737 */
3838 public function test_convert_span_to_payload (): void
3939 {
@@ -85,12 +85,13 @@ public function test_span_context_is_remote_flags(): void
8585 $ convertSpanData = static function (SpanData $ spanData ): ProtoSpan {
8686 $ converter = new SpanConverter ();
8787
88- /** @psalm-suppress InvalidArgument */
88+ /** @psalm-suppress InvalidArgument,PossiblyNullReference */
8989 return $ converter ->convert ([$ spanData ])->getResourceSpans ()[0 ]->getScopeSpans ()[0 ]->getSpans ()[0 ];
9090 };
9191
92+ /** @psalm-suppress InvalidNullableReturnType */
9293 $ getLink = static function (ProtoSpan $ protoSpan , int $ linkIndex ): ProtoSpanLink {
93- /** @psalm-suppress InvalidArgument */
94+ /** @psalm-suppress InvalidArgument,NullableReturnStatement */
9495 return $ protoSpan ->getLinks ()[$ linkIndex ];
9596 };
9697
@@ -130,6 +131,7 @@ public function test_attribute_are_coerced_correctly($actual, $expected): void
130131 $ converter = new SpanConverter ();
131132 /** @psalm-suppress InvalidArgument */
132133 $ converted = $ converter ->convert ([$ span ])->getResourceSpans ()[0 ];
134+ /** @psalm-suppress PossiblyNullReference */
133135 $ attributes = $ converted ->getScopeSpans ()[0 ]->getSpans ()[0 ]->getAttributes ();
134136
135137 // Check that we can convert all attributes to tags
@@ -308,7 +310,7 @@ public function test_resources_from_multiple_spans_are_not_duplicated(): void
308310 $ resource ->method ('getAttributes ' )->willReturn ($ attributes );
309311 $ converter = new SpanConverter ();
310312 $ result = $ converter ->convert ([$ span , $ span , $ span ])->getResourceSpans ();
311- /** @psalm-suppress InvalidArgument */
313+ /** @psalm-suppress InvalidArgument,PossiblyNullReference */
312314 $ this ->assertCount (2 , $ result [0 ]->getResource ()->getAttributes ());
313315 }
314316
@@ -339,7 +341,7 @@ public function test_otlp_no_spans(): void
339341 public function test_span_kind ($ kind , $ expected ): void
340342 {
341343 $ span = (new SpanData ())->setKind ($ kind );
342- /** @psalm-suppress InvalidArgument */
344+ /** @psalm-suppress InvalidArgument,PossiblyNullReference */
343345 $ row = (new SpanConverter ())->convert ([$ span ])->getResourceSpans ()[0 ]->getScopeSpans ()[0 ]->getSpans ()[0 ];
344346 $ this ->assertSame ($ expected , $ row ->getKind ());
345347 }
@@ -359,7 +361,7 @@ public static function spanKindProvider(): array
359361 public function test_span_with_error_status (): void
360362 {
361363 $ span = (new SpanData ())->setStatus (StatusData::error ());
362- /** @psalm-suppress InvalidArgument */
364+ /** @psalm-suppress InvalidArgument,PossiblyNullReference */
363365 $ row = (new SpanConverter ())->convert ([$ span ])->getResourceSpans ()[0 ]->getScopeSpans ()[0 ]->getSpans ()[0 ];
364366 $ this ->assertSame (V1 \Status \StatusCode::STATUS_CODE_ERROR , $ row ->getStatus ()->getCode ());
365367 }
0 commit comments