Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 135-146 (lines=12) @@
132
     * @param int    $step 步长
133
     * @return false|int
134
     */
135
    public function inc(string $name, int $step = 1)
136
    {
137
        $this->writeTimes++;
138
139
        $key = $this->getCacheKey($name);
140
141
        if ($this->handler->get($key)) {
142
            return $this->handler->increment($key, $step);
143
        }
144
145
        return $this->handler->set($key, $step);
146
    }
147
148
    /**
149
     * 自减缓存(针对数值缓存)

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

@@ 149-160 (lines=12) @@
146
     * @param int    $step 步长
147
     * @return false|int
148
     */
149
    public function inc(string $name, int $step = 1)
150
    {
151
        $this->writeTimes++;
152
153
        $key = $this->getCacheKey($name);
154
155
        if ($this->handler->get($key)) {
156
            return $this->handler->increment($key, $step);
157
        }
158
159
        return $this->handler->set($key, $step);
160
    }
161
162
    /**
163
     * 自减缓存(针对数值缓存)