Code Duplication    Length = 10-10 lines in 2 locations

src/think/cache/driver/Memcache.php 1 location

@@ 155-164 (lines=10) @@
152
     * @param int    $step 步长
153
     * @return false|int
154
     */
155
    public function dec(string $name, int $step = 1)
156
    {
157
        $this->writeTimes++;
158
159
        $key   = $this->getCacheKey($name);
160
        $value = $this->handler->get($key) - $step;
161
        $res   = $this->handler->set($key, $value);
162
163
        return !$res ? false : $value;
164
    }
165
166
    /**
167
     * 删除缓存

src/think/cache/driver/Memcached.php 1 location

@@ 169-178 (lines=10) @@
166
     * @param int    $step 步长
167
     * @return false|int
168
     */
169
    public function dec(string $name, int $step = 1)
170
    {
171
        $this->writeTimes++;
172
173
        $key   = $this->getCacheKey($name);
174
        $value = $this->handler->get($key) - $step;
175
        $res   = $this->handler->set($key, $value);
176
177
        return !$res ? false : $value;
178
    }
179
180
    /**
181
     * 删除缓存