Code Duplication    Length = 13-13 lines in 4 locations

src/phpFastCache/Core/Pool/ExtendedCacheItemPoolTrait.php 4 locations

@@ 171-183 (lines=13) @@
168
    /**
169
     * @inheritdoc
170
     */
171
    public function incrementItemsByTag($tagName, $step = 1)
172
    {
173
        if (is_string($tagName) && is_int($step)) {
174
            foreach ($this->getItemsByTag($tagName) as $item) {
175
                $item->increment($step);
176
                $this->saveDeferred($item);
177
            }
178
179
            return $this->commit();
180
        } else {
181
            throw new InvalidArgumentException('$tagName must be a string and $step an integer');
182
        }
183
    }
184
185
    /**
186
     * @inheritdoc
@@ 204-216 (lines=13) @@
201
    /**
202
     * @inheritdoc
203
     */
204
    public function decrementItemsByTag($tagName, $step = 1)
205
    {
206
        if (is_string($tagName) && is_int($step)) {
207
            foreach ($this->getItemsByTag($tagName) as $item) {
208
                $item->decrement($step);
209
                $this->saveDeferred($item);
210
            }
211
212
            return $this->commit();
213
        } else {
214
            throw new InvalidArgumentException('$tagName must be a string and $step an integer');
215
        }
216
    }
217
218
    /**
219
     * @inheritdoc
@@ 237-249 (lines=13) @@
234
    /**
235
     * @inheritdoc
236
     */
237
    public function appendItemsByTag($tagName, $data)
238
    {
239
        if (is_string($tagName)) {
240
            foreach ($this->getItemsByTag($tagName) as $item) {
241
                $item->append($data);
242
                $this->saveDeferred($item);
243
            }
244
245
            return $this->commit();
246
        } else {
247
            throw new InvalidArgumentException('$tagName must be a string');
248
        }
249
    }
250
251
    /**
252
     * @inheritdoc
@@ 270-282 (lines=13) @@
267
    /**
268
     * @inheritdoc
269
     */
270
    public function prependItemsByTag($tagName, $data)
271
    {
272
        if (is_string($tagName)) {
273
            foreach ($this->getItemsByTag($tagName) as $item) {
274
                $item->prepend($data);
275
                $this->saveDeferred($item);
276
            }
277
278
            return $this->commit();
279
        } else {
280
            throw new InvalidArgumentException('$tagName must be a string');
281
        }
282
    }
283
284
    /**
285
     * @inheritdoc