Skip to content

Commit 8aa437e

Browse files
committed
next bunch of psalm fixes
1 parent a5d0f88 commit 8aa437e

32 files changed

+49
-22
lines changed

src/Instrumentation/CakePHP/tests/Integration/CommandTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Cake\Console\TestSuite\ConsoleIntegrationTestTrait;
88

9+
/** @psalm-suppress UnusedClass */
910
class CommandTest extends TestCase
1011
{
1112
use ConsoleIntegrationTestTrait;

src/Instrumentation/Laravel/src/Hooks/Illuminate/Console/Command.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function instrument(): void
2424
$this->hookExecute();
2525
}
2626

27+
/** @psalm-suppress PossiblyUnusedReturnValue */
2728
protected function hookExecute(): bool
2829
{
2930
return hook(

src/Instrumentation/Laravel/src/Hooks/Illuminate/Contracts/Console/Kernel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public function instrument(): void
3232
}
3333
}
3434

35+
/** @psalm-suppress UnusedReturnValue */
3536
private function hookHandle(): bool
3637
{
3738
return hook(

src/Instrumentation/Laravel/src/Hooks/Illuminate/Contracts/Http/Kernel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public function instrument(): void
3333
$this->hookHandle();
3434
}
3535

36+
/** @psalm-suppress PossiblyUnusedReturnValue */
3637
protected function hookHandle(): bool
3738
{
3839
return hook(

src/Instrumentation/Laravel/src/Hooks/Illuminate/Contracts/Queue/Queue.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public function instrument(): void
3131
$this->hookPushRaw();
3232
}
3333

34+
/** @psalm-suppress PossiblyUnusedReturnValue */
3435
protected function hookBulk(): bool
3536
{
3637
return hook(
@@ -67,6 +68,7 @@ protected function hookBulk(): bool
6768
);
6869
}
6970

71+
/** @psalm-suppress PossiblyUnusedReturnValue */
7072
protected function hookLater(): bool
7173
{
7274
return hook(
@@ -110,12 +112,13 @@ protected function hookLater(): bool
110112
);
111113
}
112114

115+
/** @psalm-suppress PossiblyUnusedReturnValue */
113116
protected function hookPushRaw(): bool
114117
{
115118
return hook(
116119
QueueContract::class,
117120
'pushRaw',
118-
pre: function (QueueContract $queue, array $params, string $class, string $function, ?string $filename, ?int $lineno) {
121+
pre: function (QueueContract $queue, array $params, string $_class, string $_function, ?string $_filename, ?int $_lineno) {
119122
/** @phan-suppress-next-line PhanParamTooFewUnpack */
120123
$attributes = $this->buildMessageAttributes($queue, ...$params);
121124

src/Instrumentation/Laravel/src/Hooks/Illuminate/Foundation/Application.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ class Application implements LaravelHook
2424

2525
public function instrument(): void
2626
{
27+
/** @psalm-suppress UnusedFunctionCall */
2728
hook(
2829
FoundationalApplication::class,
2930
'__construct',
30-
post: function (FoundationalApplication $application, array $params, mixed $returnValue, ?Throwable $exception) {
31+
post: function (FoundationalApplication $application, array $_params, mixed $_returnValue, ?Throwable $_exception) {
3132
$this->registerWatchers($application, new CacheWatcher());
3233
$this->registerWatchers($application, new ClientRequestWatcher($this->instrumentation));
3334
$this->registerWatchers($application, new ExceptionWatcher());

src/Instrumentation/Laravel/src/Hooks/Illuminate/Foundation/Console/ServeCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ class ServeCommand implements LaravelHook
1818

1919
public function instrument(): void
2020
{
21+
/** @psalm-suppress UnusedFunctionCall */
2122
hook(
2223
FoundationServeCommand::class,
2324
'handle',
24-
pre: static function (FoundationServeCommand $serveCommand, array $params, string $class, string $function, ?string $filename, ?int $lineno) {
25+
pre: static function (FoundationServeCommand $_serveCommand, array $_params, string $_class, string $_function, ?string $_filename, ?int $_lineno) {
2526
if (!property_exists(FoundationServeCommand::class, 'passthroughVariables')) {
2627
return;
2728
}
2829

29-
foreach ($_ENV as $key => $value) {
30+
foreach ($_ENV as $key => $_value) {
3031
if (str_starts_with($key, 'OTEL_') && !in_array($key, FoundationServeCommand::$passthroughVariables)) {
3132
FoundationServeCommand::$passthroughVariables[] = $key;
3233
}

src/Instrumentation/Laravel/src/Hooks/Illuminate/Queue/AttributesBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,23 @@ private function contextualMessageSystemAttributes(
5050
};
5151
}
5252

53-
private function beanstalkContextualAttributes(BeanstalkdQueue $queue, array $payload, ?string $queueName = null, array $options = [], mixed ...$params): array
53+
private function beanstalkContextualAttributes(BeanstalkdQueue $queue, array $_payload, ?string $queueName = null, array $_options = [], mixed ...$_params): array
5454
{
5555
return [
5656
TraceAttributes::MESSAGING_SYSTEM => 'beanstalk',
5757
TraceAttributes::MESSAGING_DESTINATION_NAME => $queue->getQueue($queueName),
5858
];
5959
}
6060

61-
private function redisContextualAttributes(RedisQueue $queue, array $payload, ?string $queueName = null, array $options = [], mixed ...$params): array
61+
private function redisContextualAttributes(RedisQueue $queue, array $_payload, ?string $queueName = null, array $_options = [], mixed ...$_params): array
6262
{
6363
return [
6464
TraceAttributes::MESSAGING_SYSTEM => 'redis',
6565
TraceAttributes::MESSAGING_DESTINATION_NAME => $queue->getQueue($queueName),
6666
];
6767
}
6868

69-
private function awsSqsContextualAttributes(SqsQueue $queue, array $payload, ?string $queueName = null, array $options = [], mixed ...$params): array
69+
private function awsSqsContextualAttributes(SqsQueue $queue, array $_payload, ?string $queueName = null, array $_options = [], mixed ...$_params): array
7070
{
7171
return [
7272
TraceAttributes::MESSAGING_SYSTEM => TraceAttributeValues::MESSAGING_SYSTEM_AWS_SQS,

src/Instrumentation/Laravel/src/Hooks/Illuminate/Queue/Queue.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ public function instrument(): void
2121
$this->hookAbstractQueueCreatePayloadArray();
2222
}
2323

24+
/** @psalm-suppress PossiblyUnusedReturnValue */
2425
protected function hookAbstractQueueCreatePayloadArray(): bool
2526
{
2627
return hook(
2728
AbstractQueue::class,
2829
'createPayloadArray',
29-
post: function (AbstractQueue $queue, array $params, array $payload, ?Throwable $exception): array {
30+
post: function (AbstractQueue $_queue, array $_params, array $payload, ?Throwable $_exception): array {
3031
TraceContextPropagator::getInstance()->inject($payload);
3132

3233
return $payload;

src/Instrumentation/Laravel/src/Hooks/Illuminate/Queue/SyncQueue.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public function instrument(): void
2525
$this->hookPush();
2626
}
2727

28+
/** @psalm-suppress PossiblyUnusedReturnValue */
2829
protected function hookPush(): bool
2930
{
3031
return hook(

0 commit comments

Comments
 (0)