None   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 97
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 85.71%

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 2
dl 0
loc 97
ccs 12
cts 14
cp 0.8571
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A clear() 0 4 1
A getItem() 0 4 1
A deleteItem() 0 4 1
A save() 0 4 1
A hasItem() 0 4 1
A get() 0 4 1
A isSupported() 0 4 1
1
<?php
2
/**
3
 * Part of the Joomla Framework Cache Package
4
 *
5
 * @copyright  Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
6
 * @license    GNU General Public License version 2 or later; see LICENSE
7
 */
8
9
namespace Joomla\Cache\Adapter;
10
11
use Joomla\Cache\AbstractCacheItemPool;
12
use Joomla\Cache\Item\Item;
13
use Psr\Cache\CacheItemInterface;
14
15
/**
16
 * Runtime cache only driver for the Joomla Framework.
17
 *
18
 * @since       1.0
19
 * @deprecated  The joomla/cache package is deprecated
20
 */
21
class None extends AbstractCacheItemPool
0 ignored issues
show
Deprecated Code introduced by
The class Joomla\Cache\AbstractCacheItemPool has been deprecated with message: The joomla/cache package is deprecated

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
22
{
23
	/**
24
	 * This will wipe out the entire cache's keys
25
	 *
26
	 * @return  boolean  True if the pool was successfully cleared. False if there was an error.
27
	 *
28
	 * @since   1.0
29
	 */
30 19
	public function clear()
31
	{
32 19
		return true;
33
	}
34
35
	/**
36
	 * Returns a Cache Item representing the specified key.
37
	 *
38
	 * @param   string  $key  The key for which to return the corresponding Cache Item.
39
	 *
40
	 * @return  CacheItemInterface  The corresponding Cache Item.
41
	 *
42
	 * @since   __DEPLOY_VERSION__
43
	 */
44 7
	public function getItem($key)
45
	{
46 7
		return new Item($key);
0 ignored issues
show
Deprecated Code introduced by
The class Joomla\Cache\Item\Item has been deprecated with message: The joomla/cache package is deprecated

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
47
	}
48
49
	/**
50
	 * Removes the item from the pool.
51
	 *
52
	 * @param   string  $key  The key to delete.
53
	 *
54
	 * @return  boolean  True if the item was successfully removed. False if there was an error.
55
	 *
56
	 * @since   __DEPLOY_VERSION__
57
	 */
58 4
	public function deleteItem($key)
59
	{
60 4
		return true;
61
	}
62
63
	/**
64
	 * Persists a cache item immediately.
65
	 *
66
	 * @param   CacheItemInterface  $item  The cache item to save.
67
	 *
68
	 * @return  boolean  True if the item was successfully persisted. False if there was an error.
69
	 *
70
	 * @since   __DEPLOY_VERSION__
71
	 */
72 6
	public function save(CacheItemInterface $item)
73
	{
74 6
		return true;
75
	}
76
77
	/**
78
	 * Confirms if the cache contains specified cache item.
79
	 *
80
	 * @param   string  $key  The key for which to check existence.
81
	 *
82
	 * @return  boolean  True if item exists in the cache, false otherwise.
83
	 *
84
	 * @since   1.0
85
	 */
86 3
	public function hasItem($key)
87
	{
88 3
		return false;
89
	}
90
91
	/**
92
	 * Fetches a value from the cache.
93
	 *
94
	 * @param   string  $key      The unique key of this item in the cache.
95
	 * @param   mixed   $default  Default value to return if the key does not exist.
96
	 *
97
	 * @return  mixed  The value of the item from the cache, or $default in case of cache miss.
98
	 *
99
	 * @since   __DEPLOY_VERSION__
100
	 */
101 1
	public function get($key, $default = null)
102
	{
103 1
		return $default;
104
	}
105
106
	/**
107
	 * Test to see if the CacheItemPoolInterface is available
108
	 *
109
	 * @return  boolean  True on success, false otherwise
110
	 *
111
	 * @since   __DEPLOY_VERSION__
112
	 */
113
	public static function isSupported(): bool
114
	{
115
		return true;
116
	}
117
}
118