private function sanitizeStashStorageItem($item, $key)
    {
        if ( is_object($item) && ! ( $item instanceof \JsonSerializable ) ) {
            throw new StashException(
                'Can not stash value of key `'.$key.'`, provided object does not implement JsonSerializable'
            );
        }

        return $item;
    }