Completed
Push — master ( 815faa...197710 )
by Aimeos
07:55
created

None::setMultiple()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Metaways Infosystems GmbH, 2012
6
 * @copyright Aimeos (aimeos.org), 2015-2016
7
 * @package MW
8
 * @subpackage Cache
9
 */
10
11
12
namespace Aimeos\MW\Cache;
13
14
15
/**
16
 * Void caching implementation.
17
 *
18
 * @package MW
19
 * @subpackage Cache
20
 */
21
class None
22
	extends \Aimeos\MW\Cache\Base
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces between "Base" and comma; 1 found
Loading history...
23
	implements \Aimeos\MW\Cache\Iface
24
{
25
	/**
26
	 * Removes the cache entry identified by the given key.
27
	 *
28
	 * @param string $key Key string that identifies the single cache entry
29
	 */
30
	public function delete( $key )
31
	{
32
	}
33
34
35
	/**
36
	 * Removes the cache entries identified by the given keys.
37
	 *
38
	 * @param iterable $keys List of key strings that identify the cache entries
39
	 * 	that should be removed
40
	 */
41
	public function deleteMultiple( $keys )
42
	{
43
	}
44
45
46
	/**
47
	 * Removes the cache entries identified by the given tags.
48
	 *
49
	 * @param array $tags List of tag strings that are associated to one or more
50
	 * 	cache entries that should be removed
51
	 */
52
	public function deleteByTags( array $tags )
53
	{
54
	}
55
56
57
	/**
58
	 * Removes all entries from the cache so it's completely empty.
59
	 *
60
	 * This method deletes all cached entries from the cache server the client
61
	 * has access to. This method is primarily usefull to provide a clean start
62
	 * before new entries are added to the cache and you don't know which
63
	 * entries are still in the cache.
64
	 *
65
	 * @throws \Aimeos\MW\Cache\Exception If the cache server doesn't respond
66
	 */
67
	public function clear()
68
	{
69
	}
70
71
72
	/**
73
	 * Returns the value of the requested cache key.
74
	 *
75
	 * @param string $name Path to the requested value like tree/node/classname
76
	 * @param mixed $default Value returned if requested key isn't found
77
	 * @return mixed Value associated to the requested key
78
	 */
79
	public function get( $name, $default = null )
80
	{
81
		return $default;
82
	}
83
84
85
	/**
86
	 * Returns the cached values for the given cache keys.
87
	 *
88
	 * @param iterable $keys List of key strings for the requested cache entries
89
	 * @param mixed $default Default value to return for keys that do not exist
90
	 * @return array Associative list of key/value pairs for the requested cache
91
	 * 	entries. If a cache entry doesn't exist, neither its key nor a value
92
	 * 	will be in the result list
93
	 */
94
	public function getMultiple( $keys, $default = null )
95
	{
96
		$list = array();
97
98
		foreach( $keys as $key ) {
99
			$list[$key] = $default;
100
		}
101
102
		return $list;
103
	}
104
105
106
	/**
107
	 * Returns the cached keys and values associated to the given tags.
108
	 *
109
	 * @param array $tags List of tag strings associated to the requested cache entries
110
	 * @return array Associative list of key/value pairs for the requested cache
111
	 * 	entries. If a tag isn't associated to any cache entry, nothing is returned
112
	 * 	for that tag
113
	 */
114
	public function getMultipleByTags( array $tags )
115
	{
116
		return array();
117
	}
118
119
120
	/**
121
	 * Sets the value for the specified key.
122
	 *
123
	 * @param string $key Key string for the given value like product/id/123
124
	 * @param mixed $value Value string that should be stored for the given key
125
	 * @param int|string|null $expires Date/time string in "YYYY-MM-DD HH:mm:ss"
126
	 * 	format or as TTL value when the cache entry expires
127
	 * @param array $tags List of tag strings that should be assoicated to the
128
	 * 	given value in the cache
129
	 */
130
	public function set( $key, $value, $expires = null, array $tags = array() )
131
	{
132
	}
133
134
135
	/**
136
	 * Adds the given key/value pairs to the cache.
137
	 *
138
	 * @param iterable $pairs Associative list of key/value pairs. Both must be
139
	 * 	a string
140
	 * @param int|string|array $expires Associative list of keys and datetime
0 ignored issues
show
Documentation introduced by
Should the type for parameter $expires not be integer|string|array|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
141
	 *  string or integer TTL pairs.
142
	 * @param array $tags Associative list of key/tag or key/tags pairs that
143
	 *  should be associated to the values identified by their key. The value
144
	 *  associated to the key can either be a tag string or an array of tag strings
145
	 * @return null
146
	 * @throws \Aimeos\MW\Cache\Exception If the cache server doesn't respond
147
	 */
148
	public function setMultiple( $pairs, $expires = null, array $tags = array() )
149
	{
150
	}
151
}
152