think-cache希望能增加Facade注解

wapftp

在IDEA使用think-cache的方法,会提示 ```php
Non-static method 'set' should not be called statically, but the class has the '__magic' method.

# 如图

![](/upload/img/20260611/116a2ac4e9ff0a.png)

#  希望能在包中增加注释屏蔽这个警告,类似如下:

```php
/**
 * 缓存门面类
 *
 * @method static null|string getDefaultDriver() 默认驱动
 * @method static mixed getConfig(?string $name = null, mixed $default = null) 获取缓存配置
 * @method static mixed getStoreConfig(string $store, ?string $name = null, mixed $default = null) 获取驱动配置
 * @method static Driver store(?string $name = null) 连接或者切换缓存
 * @method static bool clear() 清空缓冲池
 * @method static mixed get(string $key, mixed $default = null) 读取缓存
 * @method static bool set(string $key, mixed $value, null|int|DateInterval|DateTimeInterface $ttl = null) 写入缓存
 * @method static bool delete(string $key) 删除缓存
 * @method static iterable getMultiple(iterable $keys, mixed $default = null) 批量读取缓存
 * @method static bool setMultiple(iterable $values, null|int|DateInterval|DateTimeInterface $ttl = null) 批量写入缓存
 * @method static bool deleteMultiple(iterable $keys) 批量删除缓存
 * @method static bool has(string $key) 判断缓存是否存在
 * @method static false|int inc(string $name, int $step = 1) 缓存自增
 * @method static false|int dec(string $name, int $step = 1) 缓存自减
 * @method static mixed pull(string $name) 读取缓存并删除
 * @method static void push(string $name, mixed $value) 追加(数组)缓存
 * @method static mixed remember(string $name, mixed $value, null|int|DateInterval|DateTimeInterface $expire = null) 如果不存在则写入缓存
 * @method static TagSet tag(array|string $name) 缓存标签
 * @method static void clearTag(array $keys) 删除缓存标签
 *
 * @noinspection PhpMultipleClassDeclarationsInspection
 * @see CacheManager
 * @mixin CacheManager
 */
class Cache extends Facade
{
    /**
     * 获取当前Facade对应类名
     *
     * @return string
     */
    protected static function getFacadeClass(): string
    {
        return CacheManager::class;
    }
}
84 0 0
0个回答

🔝