PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.10.8
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.10.8
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 3.10.4 All 148 releases
visualizer / vendor / phpoffice / phpspreadsheet / src / PhpSpreadsheet / Collection / Memory.php

Memory.php in Visualizer – Tables & Charts Manager with Built-in AI Generator 3.10.8, at vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Memory.php

80 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace PhpOffice\PhpSpreadsheet\Collection;
4
5 use Psr\SimpleCache\CacheInterface;
6
7 /**
8 * This is the default implementation for in-memory cell collection.
9 *
10 * Alternatives implementation should leverage off-memory, non-volatile storage
11 * to reduce overall memory usage.
12 */
13 class Memory implements CacheInterface
14 {
15 private $cache = [];
16
17 public function clear()
18 {
19 $this->cache = [];
20
21 return true;
22 }
23
24 public function delete($key)
25 {
26 unset($this->cache[$key]);
27
28 return true;
29 }
30
31 public function deleteMultiple($keys)
32 {
33 foreach ($keys as $key) {
34 $this->delete($key);
35 }
36
37 return true;
38 }
39
40 public function get($key, $default = null)
41 {
42 if ($this->has($key)) {
43 return $this->cache[$key];
44 }
45
46 return $default;
47 }
48
49 public function getMultiple($keys, $default = null)
50 {
51 $results = [];
52 foreach ($keys as $key) {
53 $results[$key] = $this->get($key, $default);
54 }
55
56 return $results;
57 }
58
59 public function has($key)
60 {
61 return array_key_exists($key, $this->cache);
62 }
63
64 public function set($key, $value, $ttl = null)
65 {
66 $this->cache[$key] = $value;
67
68 return true;
69 }
70
71 public function setMultiple($values, $ttl = null)
72 {
73 foreach ($values as $key => $value) {
74 $this->set($key, $value);
75 }
76
77 return true;
78 }
79 }
80