Code Duplication    Length = 7-8 lines in 2 locations

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

@@ 48-54 (lines=7) @@
45
     * @return string
46
     * @throws \InvalidArgumentException
47
     */
48
    public function getItemsAsJsonString(array $keys = [], $option = 0, $depth = 512)
49
    {
50
        $callback = function(CacheItemInterface $item){
51
            return $item->get();
52
        };
53
        return json_encode(array_map($callback, array_values($this->getItems($keys))), $option, $depth);
54
    }
55
56
    /**
57
     * @param string $tagName
@@ 118-125 (lines=8) @@
115
     *
116
     * @return string
117
     */
118
    public function getItemsByTagsAsJsonString(array $tagNames, $option = 0, $depth = 512)
119
    {
120
        $callback = function(CacheItemInterface $item){
121
            return $item->get();
122
        };
123
124
        return json_encode(array_map($callback, array_values($this->getItemsByTags($tagNames))), $option, $depth);
125
    }
126
127
    /**
128
     * @param string $tagName