Skip to content

Commit 925e109

Browse files
committed
Added some PHPDoc comments
1 parent 80daacc commit 925e109

File tree

5 files changed

+50
-4
lines changed

5 files changed

+50
-4
lines changed

src/Psr16/ArrayCacheEngine.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public function has($key)
4949
* @param string $key The object KEY
5050
* @param mixed $default IGNORED IN MEMCACHED.
5151
* @return mixed Description
52+
* @throws \Psr\SimpleCache\InvalidArgumentException
5253
*/
5354
public function get($key, $default = null)
5455
{

src/Psr16/BaseCacheEngine.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88

99
abstract class BaseCacheEngine implements CacheInterface, CacheAvailabilityInterface
1010
{
11+
/**
12+
* @param $keys
13+
* @param null $default
14+
* @return array|iterable
15+
* @throws \ByJG\Cache\InvalidArgumentException
16+
* @throws \Psr\SimpleCache\InvalidArgumentException
17+
*/
1118
public function getMultiple($keys, $default = null)
1219
{
1320
if (!is_array($keys)) {
@@ -20,13 +27,24 @@ public function getMultiple($keys, $default = null)
2027
return $result;
2128
}
2229

30+
/**
31+
* @param iterable $values
32+
* @param null $ttl
33+
* @return bool|void
34+
* @throws \Psr\SimpleCache\InvalidArgumentException
35+
*/
2336
public function setMultiple($values, $ttl = null)
2437
{
2538
foreach ($values as $key => $value) {
2639
$this->set($key, $value, $ttl);
2740
}
2841
}
2942

43+
/**
44+
* @param iterable $keys
45+
* @return bool|void
46+
* @throws \Psr\SimpleCache\InvalidArgumentException
47+
*/
3048
public function deleteMultiple($keys)
3149
{
3250
foreach ($keys as $key) {

src/Psr16/FileSystemCacheEngine.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ public function set($key, $value, $ttl = null)
115115
/**
116116
* @param string $key
117117
* @return bool
118+
* @throws \Psr\SimpleCache\InvalidArgumentException
118119
*/
119120
public function delete($key)
120121
{

src/Psr16/MemcachedEngine.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ protected function fixKey($key) {
3737
return "cache-" . $key;
3838
}
3939

40+
/**
41+
* @throws \Exception
42+
*/
4043
protected function lazyLoadMemCachedServers()
4144
{
4245
if (is_null($this->memCached)) {
@@ -57,6 +60,7 @@ protected function lazyLoadMemCachedServers()
5760
* @param string $key The object KEY
5861
* @param int $default IGNORED IN MEMCACHED.
5962
* @return mixed Description
63+
* @throws \Exception
6064
*/
6165
public function get($key, $default = null)
6266
{
@@ -76,6 +80,7 @@ public function get($key, $default = null)
7680
* @param object $value The object to be cached
7781
* @param int $ttl The time to live in seconds of this objects
7882
* @return bool If the object is successfully posted
83+
* @throws \Exception
7984
*/
8085
public function set($key, $value, $ttl = null)
8186
{
@@ -93,6 +98,7 @@ public function set($key, $value, $ttl = null)
9398
/**
9499
* @param string $key
95100
* @return bool
101+
* @throws \Exception
96102
*/
97103
public function delete($key)
98104
{
@@ -116,13 +122,22 @@ public function isAvailable()
116122
}
117123
}
118124

125+
/**
126+
* @return bool
127+
* @throws \Exception
128+
*/
119129
public function clear()
120130
{
121131
$this->lazyLoadMemCachedServers();
122132
$result = $this->memCached->flush();
123133
return $result;
124134
}
125135

136+
/**
137+
* @param string $key
138+
* @return bool
139+
* @throws \Exception
140+
*/
126141
public function has($key)
127142
{
128143
$this->lazyLoadMemCachedServers();

src/Psr6/CachePool.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,11 @@ protected function removeElementFromBuffer($key)
107107

108108
/**
109109
* Psr implementation of getItem()
110-
*
110+
*
111111
* @param string $key
112112
* @return CacheItem
113+
* @throws \Psr\SimpleCache\InvalidArgumentException
114+
* @throws \Psr\SimpleCache\InvalidArgumentException
113115
*/
114116
public function getItem($key)
115117
{
@@ -132,9 +134,10 @@ public function getItem($key)
132134

133135
/**
134136
* Psr implementation of getItems()
135-
*
137+
*
136138
* @param array $keys
137139
* @return array
140+
* @throws \Psr\SimpleCache\InvalidArgumentException
138141
*/
139142
public function getItems(array $keys = array())
140143
{
@@ -148,9 +151,10 @@ public function getItems(array $keys = array())
148151

149152
/**
150153
* Psr implementation of hasItems()
151-
*
154+
*
152155
* @param string $key
153156
* @return bool
157+
* @throws \Psr\SimpleCache\InvalidArgumentException
154158
*/
155159
public function hasItem($key)
156160
{
@@ -171,6 +175,7 @@ public function clear()
171175
*
172176
* @param string $key
173177
* @return bool
178+
* @throws \Psr\SimpleCache\InvalidArgumentException
174179
*/
175180
public function deleteItem($key)
176181
{
@@ -179,9 +184,11 @@ public function deleteItem($key)
179184

180185
/**
181186
* Psr Implementation of deleteItems()
182-
*
187+
*
183188
* @param array $keys
184189
* @return bool
190+
* @throws \Psr\SimpleCache\InvalidArgumentException
191+
* @throws \Psr\SimpleCache\InvalidArgumentException
185192
*/
186193
public function deleteItems(array $keys)
187194
{
@@ -196,6 +203,8 @@ public function deleteItems(array $keys)
196203
/**
197204
* @param CacheItemInterface $item
198205
* @return bool
206+
* @throws \Psr\SimpleCache\InvalidArgumentException
207+
* @throws \Psr\SimpleCache\InvalidArgumentException
199208
*/
200209
public function save(CacheItemInterface $item)
201210
{
@@ -232,6 +241,8 @@ public function saveDeferred(CacheItemInterface $item)
232241

233242
/**
234243
* Psr implementation of commit()
244+
*
245+
* @throws \Psr\SimpleCache\InvalidArgumentException
235246
*/
236247
public function commit()
237248
{

0 commit comments

Comments
 (0)