/**
* Wraps the callback passed to ->get() in a callable.
*
* @return callable the previous callback wrapper
*/
public function setCallbackWrapper(?callable
$callbackWrapper): callable
{ if (!
isset($this->callbackWrapper
)) { $this->callbackWrapper = LockRegistry::
compute(...
);
if (\
in_array(\PHP_SAPI,
['cli', 'phpdbg'
], true
)) { $this->
setCallbackWrapper(null
);
} } if (null !==
$callbackWrapper && !
$callbackWrapper instanceof \Closure
) { $callbackWrapper =
$callbackWrapper(...
);
} $previousWrapper =
$this->callbackWrapper;
$this->callbackWrapper =
$callbackWrapper ??
static fn (callable
$callback, ItemInterface
$item, bool &
$save, CacheInterface
$pool, \Closure
$setMetadata, ?LoggerInterface
$logger) =>
$callback($item,
$save);
return $previousWrapper;
}