| @@ 46-52 (lines=7) @@ | ||
| 43 | * @return string |
|
| 44 | * @throws \InvalidArgumentException |
|
| 45 | */ |
|
| 46 | public function getItemsAsJsonString(array $keys = [], $option = 0, $depth = 512) |
|
| 47 | { |
|
| 48 | $callback = function(CacheItemInterface $item){ |
|
| 49 | return $item->get(); |
|
| 50 | }; |
|
| 51 | return json_encode(array_map($callback, array_values($this->getItems($keys))), $option, $depth); |
|
| 52 | } |
|
| 53 | ||
| 54 | /** |
|
| 55 | * @param string $tagName |
|
| @@ 104-111 (lines=8) @@ | ||
| 101 | * |
|
| 102 | * @return string |
|
| 103 | */ |
|
| 104 | public function getItemsByTagsAsJsonString(array $tagNames, $option = 0, $depth = 512) |
|
| 105 | { |
|
| 106 | $callback = function(CacheItemInterface $item){ |
|
| 107 | return $item->get(); |
|
| 108 | }; |
|
| 109 | ||
| 110 | return json_encode(array_map($callback, array_values($this->getItemsByTags($tagNames))), $option, $depth); |
|
| 111 | } |
|
| 112 | ||
| 113 | /** |
|
| 114 | * @param string $tagName |
|