Skip to content

Commit 5e59fb1

Browse files
committed
Merge branch '8.0' of github.com:top-think/framework into 8.0
2 parents b8e1baf + a272dd0 commit 5e59fb1

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

src/think/Cache.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use DateTimeInterface;
1717
use Psr\SimpleCache\CacheInterface;
1818
use think\cache\Driver;
19+
use think\cache\TagSet;
1920
use think\exception\InvalidArgumentException;
2021
use think\helper\Arr;
2122

@@ -185,4 +186,15 @@ public function has($key): bool
185186
return $this->store()->has($key);
186187
}
187188

189+
/**
190+
* 缓存标签
191+
* @access public
192+
* @param string|array $name 标签名
193+
* @return TagSet
194+
*/
195+
public function tag($name)
196+
{
197+
return $this->store()->tag($name);
198+
}
199+
188200
}

src/think/cache/Driver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public function remember($name, $value, $expire = null)
192192
* @param string|array $name 标签名
193193
* @return TagSet
194194
*/
195-
public function tag($name): TagSet
195+
public function tag($name)
196196
{
197197
$name = (array) $name;
198198
$key = implode('-', $name);

src/think/contract/CacheHandlerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function remember($name, $value, $expire = null);
6060
* @param string|array $name 标签名
6161
* @return TagSet
6262
*/
63-
public function tag($name): TagSet;
63+
public function tag($name);
6464

6565
/**
6666
* 删除缓存标签

0 commit comments

Comments
 (0)