@@ 46-54 (lines=9) @@ | ||
43 | /** |
|
44 | * {@inheritDoc} |
|
45 | */ |
|
46 | public function set($key, $value, $ttl = null) |
|
47 | { |
|
48 | ||
49 | $this->checkReservedCharacters($key); |
|
50 | if ($ttl instanceof DateInterval) { |
|
51 | $ttl = (new DateTime('now'))->add($ttl)->getTimeStamp() - time(); |
|
52 | } |
|
53 | return $this->handler->set($key, $value, (int) $ttl); |
|
54 | } |
|
55 | ||
56 | /** |
|
57 | * {@inheritDoc} |
|
@@ 89-98 (lines=10) @@ | ||
86 | /** |
|
87 | * {@inheritDoc} |
|
88 | */ |
|
89 | public function setMultiple($values, $ttl = null) |
|
90 | { |
|
91 | foreach ($values as $key => $value) { |
|
92 | $this->checkReservedCharacters($key); |
|
93 | } |
|
94 | if ($ttl instanceof DateInterval) { |
|
95 | $ttl = (new DateTime('now'))->add($ttl)->getTimeStamp() - time(); |
|
96 | } |
|
97 | return $this->handler->setMulti($values, (int) $ttl); |
|
98 | } |
|
99 | ||
100 | /** |
|
101 | * {@inheritDoc} |