Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 7
CRAP
0.00% covered (danger)
0.00%
0 / 1
EmptyBagOStuff
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 7
56
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 doGet
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 doSet
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 doDelete
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 doAdd
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 doIncrWithInit
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 merge
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * Dummy object caching.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
19 *
20 * @file
21 * @ingroup Cache
22 */
23
24/**
25 * A BagOStuff object with no objects in it. Used to provide a no-op object to calling code.
26 *
27 * @ingroup Cache
28 */
29class EmptyBagOStuff extends MediumSpecificBagOStuff {
30    public function __construct( array $params = [] ) {
31        parent::__construct( $params );
32
33        $this->attrMap[self::ATTR_DURABILITY] = self::QOS_DURABILITY_NONE;
34    }
35
36    protected function doGet( $key, $flags = 0, &$casToken = null ) {
37        $casToken = null;
38
39        return false;
40    }
41
42    protected function doSet( $key, $value, $exptime = 0, $flags = 0 ) {
43        return true;
44    }
45
46    protected function doDelete( $key, $flags = 0 ) {
47        return true;
48    }
49
50    protected function doAdd( $key, $value, $exptime = 0, $flags = 0 ) {
51        return true;
52    }
53
54    protected function doIncrWithInit( $key, $exptime, $step, $init, $flags ) {
55        // faster
56        return $init;
57    }
58
59    public function merge( $key, callable $callback, $exptime = 0, $attempts = 10, $flags = 0 ) {
60        // faster
61        return true;
62    }
63}