Skip to content

Commit

Permalink
fix: add missing method setCallbackWrapper (#841)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Bouma <[email protected]>
  • Loading branch information
shakaran and stayallive authored Jul 1, 2024
1 parent 5de2b84 commit b138816
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Tracing/Cache/TraceableCacheAdapterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,17 @@ private function traceFunction(string $spanOperation, \Closure $callback, string
}
}
}

/**
* @phpstan-param \Closure(CacheItem): CacheItem $callback
* @phpstan-param string $key
*
* @phpstan-return callable(): CacheItem
*/
private function setCallbackWrapper(callable $callback, string $key): callable
{
return function () use ($callback, $key): CacheItem {
return $callback($this->decoratedAdapter->getItem($key));
};
}
}

0 comments on commit b138816

Please sign in to comment.