Edit File by line
/home/zeestwma/redstone.../wp-inclu.../SimplePi.../src/Cache
File: DataCache.php
<?php
[0] Fix | Delete
[1] Fix | Delete
// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue
[2] Fix | Delete
// SPDX-License-Identifier: BSD-3-Clause
[3] Fix | Delete
[4] Fix | Delete
declare(strict_types=1);
[5] Fix | Delete
[6] Fix | Delete
namespace SimplePie\Cache;
[7] Fix | Delete
[8] Fix | Delete
use InvalidArgumentException;
[9] Fix | Delete
[10] Fix | Delete
/**
[11] Fix | Delete
* Subset of PSR-16 Cache client for caching data arrays
[12] Fix | Delete
*
[13] Fix | Delete
* Only get(), set() and delete() methods are used,
[14] Fix | Delete
* but not has(), getMultiple(), setMultiple() or deleteMultiple().
[15] Fix | Delete
*
[16] Fix | Delete
* The methods names must be different, but should be compatible to the
[17] Fix | Delete
* methods of \Psr\SimpleCache\CacheInterface.
[18] Fix | Delete
*
[19] Fix | Delete
* @internal
[20] Fix | Delete
*/
[21] Fix | Delete
interface DataCache
[22] Fix | Delete
{
[23] Fix | Delete
/**
[24] Fix | Delete
* Fetches a value from the cache.
[25] Fix | Delete
*
[26] Fix | Delete
* Equivalent to \Psr\SimpleCache\CacheInterface::get()
[27] Fix | Delete
* <code>
[28] Fix | Delete
* public function get(string $key, mixed $default = null): mixed;
[29] Fix | Delete
* </code>
[30] Fix | Delete
*
[31] Fix | Delete
* @param string $key The unique key of this item in the cache.
[32] Fix | Delete
* @param mixed $default Default value to return if the key does not exist.
[33] Fix | Delete
*
[34] Fix | Delete
* @return array|mixed The value of the item from the cache, or $default in case of cache miss.
[35] Fix | Delete
*
[36] Fix | Delete
* @throws InvalidArgumentException
[37] Fix | Delete
* MUST be thrown if the $key string is not a legal value.
[38] Fix | Delete
*/
[39] Fix | Delete
public function get_data(string $key, $default = null);
[40] Fix | Delete
[41] Fix | Delete
/**
[42] Fix | Delete
* Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time.
[43] Fix | Delete
*
[44] Fix | Delete
* Equivalent to \Psr\SimpleCache\CacheInterface::set()
[45] Fix | Delete
* <code>
[46] Fix | Delete
* public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null): bool;
[47] Fix | Delete
* </code>
[48] Fix | Delete
*
[49] Fix | Delete
* @param string $key The key of the item to store.
[50] Fix | Delete
* @param array<mixed> $value The value of the item to store, must be serializable.
[51] Fix | Delete
* @param null|int $ttl Optional. The TTL value of this item. If no value is sent and
[52] Fix | Delete
* the driver supports TTL then the library may set a default value
[53] Fix | Delete
* for it or let the driver take care of that.
[54] Fix | Delete
*
[55] Fix | Delete
* @return bool True on success and false on failure.
[56] Fix | Delete
*
[57] Fix | Delete
* @throws InvalidArgumentException
[58] Fix | Delete
* MUST be thrown if the $key string is not a legal value.
[59] Fix | Delete
*/
[60] Fix | Delete
public function set_data(string $key, array $value, ?int $ttl = null): bool;
[61] Fix | Delete
[62] Fix | Delete
/**
[63] Fix | Delete
* Delete an item from the cache by its unique key.
[64] Fix | Delete
*
[65] Fix | Delete
* Equivalent to \Psr\SimpleCache\CacheInterface::delete()
[66] Fix | Delete
* <code>
[67] Fix | Delete
* public function delete(string $key): bool;
[68] Fix | Delete
* </code>
[69] Fix | Delete
*
[70] Fix | Delete
* @param string $key The unique cache key of the item to delete.
[71] Fix | Delete
*
[72] Fix | Delete
* @return bool True if the item was successfully removed. False if there was an error.
[73] Fix | Delete
*
[74] Fix | Delete
* @throws InvalidArgumentException
[75] Fix | Delete
* MUST be thrown if the $key string is not a legal value.
[76] Fix | Delete
*/
[77] Fix | Delete
public function delete_data(string $key): bool;
[78] Fix | Delete
}
[79] Fix | Delete
[80] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function