Stash\Interfaces\ItemInterface::get PHP Method

get() public method

Returns the data retrieved from the cache. Since this can return false or null as a correctly cached value, the return value should not be used to determine successful retrieval of data- for that use the "isMiss()" function after call this one. If no value is stored at all then this function will return null.
public get ( ) : mixed
return mixed
    public function get();

Usage Example

Example #1
0
 function it_shortens_a_url(PoolInterface $pool, ItemInterface $item)
 {
     $item->isMiss()->willReturn(false);
     $item->get()->willReturn('http://short.ly/1234');
     $pool->getItem(md5('http://any.url'))->willReturn($item);
     $this->shorten('http://any.url')->shouldReturn('http://short.ly/1234');
 }
All Usage Examples Of Stash\Interfaces\ItemInterface::get