You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* This component offers caching capabilities for your application.
19
11
* Phalcon\Cache implements PSR-16.
20
12
*/
21
-
class Cache implements CacheInterface
13
+
class Cache implements\Psr\SimpleCache\CacheInterface
22
14
{
23
15
/**
24
16
* The adapter
@@ -49,7 +41,7 @@ public function __construct(\Phalcon\Cache\Adapter\AdapterInterface $adapter)
49
41
/**
50
42
* Wipes clean the entire cache's keys.
51
43
*
52
-
* @return bool
44
+
* @return bool True on success and false on failure.
53
45
*/
54
46
publicfunctionclear(): bool
55
47
{
@@ -62,9 +54,7 @@ public function clear(): bool
62
54
*
63
55
* @return bool True if the item was successfully removed. False if there was an error.
64
56
*
65
-
* @throws Phalcon\Cache\Exception\InvalidArgumentException MUST be thrown if the $key string is not a legal value.
66
-
* @param mixed $key
67
-
* @return bool
57
+
* @throws InvalidArgumentException MUST be thrown if the $key string is not a legal value.
68
58
*/
69
59
publicfunctiondelete($key): bool
70
60
{
@@ -77,9 +67,7 @@ public function delete($key): bool
77
67
*
78
68
* @return bool True if the items were successfully removed. False if there was an error.
79
69
*
80
-
* @throws Phalcon\Cache\Exception\InvalidArgumentException MUST be thrown if $keys is neither an array nor a Traversable, or if any of the $keys are not a legal value.
81
-
* @param mixed $keys
82
-
* @return bool
70
+
* @throws InvalidArgumentException MUST be thrown if $keys is neither an array nor a Traversable, or if any of the $keys are not a legal value.
83
71
*/
84
72
publicfunctiondeleteMultiple($keys): bool
85
73
{
@@ -88,14 +76,12 @@ public function deleteMultiple($keys): bool
88
76
/**
89
77
* Fetches a value from the cache.
90
78
*
91
-
* @param mixed $default Default value to return if the key does not exist.
79
+
* @param string $key The unique key of this item in the cache.
80
+
* @param mixed $defaultValue Default value to return if the key does not exist.
92
81
*
93
82
* @return mixed The value of the item from the cache, or $default in case of cache miss.
94
83
*
95
-
* @throws Phalcon\Cache\Exception\InvalidArgumentException MUST be thrown if the $key string is not a legal value.
96
-
* @param string $key The unique key of this item in the cache.
97
-
* @param mixed $defaultValue
98
-
* @return mixed
84
+
* @throws InvalidArgumentException MUST be thrown if the $key string is not a legal value.
99
85
*/
100
86
publicfunctionget($key, $defaultValue = null)
101
87
{
@@ -104,14 +90,12 @@ public function get($key, $defaultValue = null)
104
90
/**
105
91
* Obtains multiple cache items by their unique keys.
106
92
*
107
-
* @param mixed $default Default value to return for keys that do not exist.
93
+
* @param iterable $keys A list of keys that can obtained in a single operation.
94
+
* @param mixed $defaultValue Default value to return for keys that do not exist.
108
95
*
109
96
* @return iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value.
110
97
*
111
-
* @throws Phalcon\Cache\Exception\InvalidArgumentException MUST be thrown if $keys is neither an array nor a Traversable, or if any of the $keys are not a legal value.
112
-
* @param iterable $keys A list of keys that can obtained in a single operation.
113
-
* @param mixed $defaultValue
114
-
* @return mixed
98
+
* @throws InvalidArgumentException MUST be thrown if $keys is neither an array nor a Traversable, or if any of the $keys are not a legal value.
@@ -154,16 +134,14 @@ public function set($key, $value, $ttl = null): bool
154
134
/**
155
135
* Persists a set of key => value pairs in the cache, with an optional TTL.
156
136
*
157
-
* @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and
137
+
* @param iterable $values A list of key => value pairs for a multiple-set operation.
138
+
* @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and
158
139
* the driver supports TTL then the library may set a default value
159
140
* for it or let the driver take care of that.
160
141
*
161
142
* @return bool True on success and false on failure.
162
143
*
163
-
* @throws Phalcon\Cache\Exception\InvalidArgumentException MUST be thrown if $values is neither an array nor a Traversable, or if any of the $values are not a legal value.
164
-
* @param iterable $values A list of key => value pairs for a multiple-set operation.
165
-
* @param mixed $ttl
166
-
* @return bool
144
+
* @throws InvalidArgumentException MUST be thrown if $values is neither an array nor a Traversable, or if any of the $values are not a legal value.
* For the full copyright and license information, please view the LICENSE.txt
9
-
* file that was distributed with this source code.
10
-
*/
11
-
12
3
namespacePhalcon;
13
4
14
-
useArrayAccess;
15
-
useCountable;
16
-
useIteratorAggregate;
17
-
useJsonSerializable;
18
-
useSerializable;
19
5
useTraversable;
20
6
21
7
/**
22
-
* `Phalcon\Collection` is a supercharged object oriented array. It implements [ArrayAccess](https://www.php.net/manual/en/class.arrayaccess.php), [Countable](https://www.php.net/manual/en/class.countable.php), [IteratorAggregate](https://www.php.net/manual/en/class.iteratoraggregate.php), [JsonSerializable](https://www.php.net/manual/en/class.jsonserializable.php), [Serializable](https://www.php.net/manual/en/class.serializable.php)
8
+
* `Phalcon\Collection` is a supercharged object oriented array. It implements:
0 commit comments