Code Duplication    Length = 12-12 lines in 2 locations

src/phpFastCache/Core/Item/ItemExtendedTrait.php 2 locations

@@ 194-205 (lines=12) @@
191
     * @return $this
192
     * @throws \InvalidArgumentException
193
     */
194
    public function append($data)
195
    {
196
        if (is_array($this->data)) {
197
            array_push($this->data, $data);
198
        } else if (is_string($data)) {
199
            $this->data .= (string) $data;
200
        } else {
201
            throw new \InvalidArgumentException('$data must be either array nor string.');
202
        }
203
204
        return $this;
205
    }
206
207
208
    /**
@@ 213-224 (lines=12) @@
210
     * @return $this
211
     * @throws \InvalidArgumentException
212
     */
213
    public function prepend($data)
214
    {
215
        if (is_array($this->data)) {
216
            array_unshift($this->data, $data);
217
        } else if (is_string($data)) {
218
            $this->data = (string) $data . $this->data;
219
        } else {
220
            throw new \InvalidArgumentException('$data must be either array nor string.');
221
        }
222
223
        return $this;
224
    }
225
226
    /**
227
     * @param $tagName