Code Duplication    Length = 12-12 lines in 2 locations

src/phpFastCache/Cache/ItemBaseTrait.php 2 locations

@@ 250-261 (lines=12) @@
247
     * @return $this
248
     * @throws \InvalidArgumentException
249
     */
250
    public function append($data)
251
    {
252
        if (is_array($this->data)) {
253
            array_push($this->data, $data);
254
        } else if (is_string($data)) {
255
            $this->data .= (string) $data;
256
        } else {
257
            throw new \InvalidArgumentException('$data must be either array nor string.');
258
        }
259
260
        return $this;
261
    }
262
263
264
    /**
@@ 269-280 (lines=12) @@
266
     * @return $this
267
     * @throws \InvalidArgumentException
268
     */
269
    public function prepend($data)
270
    {
271
        if (is_array($this->data)) {
272
            array_unshift($this->data, $data);
273
        } else if (is_string($data)) {
274
            $this->data = (string) $data . $this->data;
275
        } else {
276
            throw new \InvalidArgumentException('$data must be either array nor string.');
277
        }
278
279
        return $this;
280
    }
281
282
    /**
283
     * @param $tagName