Skip to content

Commit b138816

Browse files
shakaranstayallive
andauthored
fix: add missing method setCallbackWrapper (#841)
Co-authored-by: Alex Bouma <[email protected]>
1 parent 5de2b84 commit b138816

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Tracing/Cache/TraceableCacheAdapterTrait.php

+13
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,17 @@ private function traceFunction(string $spanOperation, \Closure $callback, string
190190
}
191191
}
192192
}
193+
194+
/**
195+
* @phpstan-param \Closure(CacheItem): CacheItem $callback
196+
* @phpstan-param string $key
197+
*
198+
* @phpstan-return callable(): CacheItem
199+
*/
200+
private function setCallbackWrapper(callable $callback, string $key): callable
201+
{
202+
return function () use ($callback, $key): CacheItem {
203+
return $callback($this->decoratedAdapter->getItem($key));
204+
};
205+
}
193206
}

0 commit comments

Comments
 (0)