/** * Handle the message to retrieve the cached content from the injected cache proxy * with a callback used as a fallback. * @param \Brickoo\Component\Messaging\Message $message * @return mixed the cached content otherwise null */ public function handleRetrieveByCallbackMessage(Message $message) { if ($message instanceof RetrieveByCallbackMessage) { return $this->storageProxy->getByCallback($message->getIdentifier(), $message->getCallback(), $message->getCallbackArguments(), $message->getLifetime()); } return null; }
/** * @covers Brickoo\Component\Storage\StorageProxy::getByCallback * @expectedException \InvalidArgumentException */ public function testGetByCallbackLifetimeThrowsInvalidArgumentException() { $storageProxy = new StorageProxy($this->getAdapterPoolIterator()); $storageProxy->getByCallback("some_identifier", function () { }, [], "wrongType"); }