Skip to content

Commit a5d0f88

Browse files
committed
next bunch of psalm fixes
1 parent 3c997b1 commit a5d0f88

File tree

9 files changed

+5
-19
lines changed

9 files changed

+5
-19
lines changed

src/Instrumentation/Symfony/tests/Integration/HttpClientInstrumentationTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public function test_send_request(string $method, string $uri, int $statusCode,
3838
$response->getStatusCode();
3939
$this->assertCount(1, $this->storage);
4040

41-
/** @var ImmutableSpan $span */
4241
$span = $this->storage[0];
4342

4443
$this->assertStringContainsString($method, $span->getName());
@@ -74,9 +73,7 @@ public function test_throw_exception(): void
7473

7574
$this->assertCount(1, $this->storage);
7675

77-
/** @var ImmutableSpan $span */
7876
$span = $this->storage[0];
79-
/** @var EventInterface $event */
8077
$event = $span->getEvents()[0];
8178

8279
$this->assertTrue($span->getAttributes()->has(TraceAttributes::URL_FULL));

src/Instrumentation/Symfony/tests/Integration/MessengerInstrumentationTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public function __construct(string $message)
2323
$this->message = $message;
2424
}
2525

26+
/** @psalm-suppress PossiblyUnusedMethod */
2627
public function getMessage(): string
2728
{
2829
return $this->message;
@@ -61,7 +62,6 @@ public function test_dispatch_message($message, string $spanName, int $kind, arr
6162

6263
$this->assertCount(1, $this->storage);
6364

64-
/** @var ImmutableSpan $span */
6565
$span = $this->storage[0];
6666

6767
$this->assertEquals($spanName, $span->getName());
@@ -87,7 +87,6 @@ public function test_send_message($message, string $spanName, int $kind, array $
8787

8888
$this->assertCount(1, $this->storage);
8989

90-
/** @var ImmutableSpan $span */
9190
$span = $this->storage[0];
9291

9392
$this->assertEquals($spanName, $span->getName());

src/Instrumentation/Symfony/tests/Integration/SymfonyInstrumentationTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ public function test_http_kernel_handle_subrequest(): void
200200
$kernel->handle($request, HttpKernelInterface::SUB_REQUEST);
201201
$this->assertCount(1, $this->storage);
202202

203-
/** @var ImmutableSpan $span */
204203
$span = $this->storage[0];
205204
$this->assertSame('GET ErrorController', $span->getName());
206205
$this->assertSame(SpanKind::KIND_INTERNAL, $span->getKind());

src/Logs/Monolog/tests/Benchmark/LoggingBench.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Monolog\Logger;
66
use OpenTelemetry\Contrib\Logs\Monolog\Handler;
77

8+
/** @psalm-suppress UnusedClass */
89
class LoggingBench
910
{
1011
private array $loggers = [];

src/Sampler/RuleBased/psalm.xml.dist

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@
2020
<directory name="src/ComponentProvider"/>
2121
</errorLevel>
2222
</UndefinedInterfaceMethod>
23-
<PossiblyNullReference>
24-
<errorLevel type="suppress">
25-
<directory name="src/ComponentProvider"/>
26-
</errorLevel>
27-
</PossiblyNullReference>
2823
<MoreSpecificImplementedParamType>
2924
<errorLevel type="suppress">
3025
<directory name="src/ComponentProvider"/>

src/Shims/OpenTracing/src/SpanContext.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public function withBaggageItem(string $key, string $value): API\SpanContext
4343
return new self($this->context, [$key => $value] + $this->baggageItems);
4444
}
4545

46+
/** @psalm-suppress PossiblyUnusedMethod */
4647
public function getContext(): ContextInterface
4748
{
4849
return $this->context;

src/Symfony/psalm.xml.dist

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,4 @@
1818
<plugins>
1919
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
2020
</plugins>
21-
<issueHandlers>
22-
<UndefinedDocblockClass>
23-
<errorLevel type="suppress">
24-
<file name="src/OtelSdkBundle/DependencyInjection/OtelSdkExtension.php" />
25-
<referencedClass name="Symfony\Component\DependencyInjection\ContainerBuilder" />
26-
</errorLevel>
27-
</UndefinedDocblockClass>
28-
</issueHandlers>
2921
</psalm>

src/Symfony/src/OtelSdkBundle/Factory/GenericFactoryTrait.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ private function parameterCallback(ReflectionParameter $parameter, string $optio
228228

229229
private static function camelToSnakeCase(string $value): string
230230
{
231+
/** @psalm-suppress PossiblyNullArgument */
231232
return strtolower(
232233
ltrim(
233234
preg_replace(

src/Symfony/src/OtelSdkBundle/Util/ServiceHelper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class ServiceHelper
1212
*/
1313
public static function classToId(string $class): string
1414
{
15+
/** @psalm-suppress PossiblyNullArgument */
1516
return str_replace(
1617
'\_',
1718
'.',

0 commit comments

Comments
 (0)