@@ 142-153 (lines=12) @@ | ||
139 | * |
|
140 | * @return string |
|
141 | */ |
|
142 | public function read($key) |
|
143 | { |
|
144 | $this->assertHasFile($key); |
|
145 | ||
146 | $content = $this->adapter->read($key); |
|
147 | ||
148 | if (false === $content) { |
|
149 | throw new \RuntimeException(sprintf('Could not read the "%s" key content.', $key)); |
|
150 | } |
|
151 | ||
152 | return $content; |
|
153 | } |
|
154 | ||
155 | /** |
|
156 | * Deletes the file matching the specified key. |
|
@@ 164-174 (lines=11) @@ | ||
161 | * |
|
162 | * @return bool |
|
163 | */ |
|
164 | public function delete($key) |
|
165 | { |
|
166 | $this->assertHasFile($key); |
|
167 | ||
168 | if ($this->adapter->delete($key)) { |
|
169 | $this->removeFromRegister($key); |
|
170 | ||
171 | return true; |
|
172 | } |
|
173 | ||
174 | throw new \RuntimeException(sprintf('Could not remove the "%s" key.', $key)); |
|
175 | } |
|
176 | ||
177 | /** |