Skip to content

Commit 68b835f

Browse files
committed
fix(Instrumentation/Cache): add iterable value type for $metadata parameter
Satisfies PHPStan's missingType.iterableValue rule on the get() methods of TraceableCacheAdapter and TagAwareTraceableCacheAdapter while staying contravariant with Symfony's CacheInterface::get() signature.
1 parent 38e07e6 commit 68b835f

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/Instrumentation/Symfony/Cache/TagAwareTraceableCacheAdapter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ public function __construct(
2525
$this->logger = $logger;
2626
}
2727

28+
/**
29+
* @param array<array-key, mixed>|null $metadata
30+
*/
2831
public function get(string $key, callable $callback, ?float $beta = null, ?array &$metadata = null): mixed
2932
{
3033
return $this->tracer->traceFunction(

src/Instrumentation/Symfony/Cache/TraceableCacheAdapter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ public function __construct(
2424
$this->logger = $logger;
2525
}
2626

27+
/**
28+
* @param array<array-key, mixed>|null $metadata
29+
*/
2730
public function get(string $key, callable $callback, ?float $beta = null, ?array &$metadata = null): mixed
2831
{
2932
return $this->tracer->traceFunction(

0 commit comments

Comments
 (0)