Code Duplication    Length = 12-12 lines in 2 locations

src/phpFastCache/Cache/ItemBaseTrait.php 2 locations

@@ 277-288 (lines=12) @@
274
     * @return $this
275
     * @throws \InvalidArgumentException
276
     */
277
    public function append($data)
278
    {
279
        if (is_array($this->data)) {
280
            array_push($this->data, $data);
281
        } else if (is_string($data)) {
282
            $this->data .= (string) $data;
283
        } else {
284
            throw new \InvalidArgumentException('$data must be either array nor string.');
285
        }
286
287
        return $this;
288
    }
289
290
291
    /**
@@ 296-307 (lines=12) @@
293
     * @return $this
294
     * @throws \InvalidArgumentException
295
     */
296
    public function prepend($data)
297
    {
298
        if (is_array($this->data)) {
299
            array_unshift($this->data, $data);
300
        } else if (is_string($data)) {
301
            $this->data = (string) $data . $this->data;
302
        } else {
303
            throw new \InvalidArgumentException('$data must be either array nor string.');
304
        }
305
306
        return $this;
307
    }
308
309
    /**
310
     * @param $tagName