Cache\Encryption\EncryptedItemDecorator::set PHP Method

set() public method

public set ( $value )
    public function set($value)
    {
        $type = gettype($value);
        if ($type === 'object') {
            $value = serialize($value);
        }
        $json = json_encode(['type' => $type, 'value' => $value]);
        $this->cacheItem->set(Crypto::encrypt($json, $this->key));
        return $this;
    }