浏览代码

refactor(LCache): 优化缓存项属性访问和代码格式- 将 CacheItem 类中的 isHit 属性从 public 改为 private,提高封装性
-移除 QueueCache 文件中的多余空行,优化代码格式

notfff 7 月之前
父节点
当前提交
177fee635d
共有 2 个文件被更改,包括 1 次插入2 次删除
  1. 1 1
      app/Module/LCache/CacheItem.php
  2. 0 1
      app/Module/LCache/QueueCache.php

+ 1 - 1
app/Module/LCache/CacheItem.php

@@ -17,7 +17,7 @@ class CacheItem implements CacheItemInterface
 
     public mixed $value;
 
-    public bool $isHit;
+    private bool $isHit;
 
 
     public function __construct(string $key, mixed $value = null, int $create_ts = 0, int $ttl = 0)

+ 0 - 1
app/Module/LCache/QueueCache.php

@@ -88,7 +88,6 @@ trait QueueCache
         // 3ee2d37c91b4abcf418bd24c0c0e1dea
         // 3ee2d37c91b4abcf418bd24c0c0e1dea
 
-
         if (!$item->isHit()) {
             $force = true;
         }