Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
40.00% |
2 / 5 |
|
40.00% |
2 / 5 |
CRAP | |
0.00% |
0 / 1 |
| NoCache | |
40.00% |
2 / 5 |
|
40.00% |
2 / 5 |
10.40 | |
0.00% |
0 / 1 |
| set | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| clear | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| delete | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| get | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| has | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2020 (original work) Open Assessment Technologies SA |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | namespace oat\oatbox\cache; |
| 23 | |
| 24 | use oat\oatbox\service\ConfigurableService; |
| 25 | |
| 26 | /** |
| 27 | * Caches data in a key-value store |
| 28 | * |
| 29 | * @access public |
| 30 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 31 | * @package generis |
| 32 | */ |
| 33 | class NoCache extends ConfigurableService implements SimpleCache |
| 34 | { |
| 35 | use MultipleCacheTrait; |
| 36 | |
| 37 | public function set($key, $value, $ttl = null) |
| 38 | { |
| 39 | return true; |
| 40 | } |
| 41 | |
| 42 | public function clear() |
| 43 | { |
| 44 | return true; |
| 45 | } |
| 46 | |
| 47 | public function delete($key) |
| 48 | { |
| 49 | return true; |
| 50 | } |
| 51 | |
| 52 | public function get($key, $default = null) |
| 53 | { |
| 54 | return $default; |
| 55 | } |
| 56 | |
| 57 | public function has($key) |
| 58 | { |
| 59 | return false; |
| 60 | } |
| 61 | } |