Completed
Push — 2.0-dev ( 8297cc...96e0ca )
by George
9s
created

None::save()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 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
 */
20
class None extends AbstractCacheItemPool
21
{
22
	/**
23
	 * This will wipe out the entire cache's keys
24
	 *
25
	 * @return  boolean  The result of the clear operation.
26
	 *
27
	 * @since   1.0
28
	 */
29 12
	public function clear()
30
	{
31 12
		return true;
32
	}
33
34
	/**
35
	 * Method to get a storage entry value from a key.
36
	 *
37
	 * @param   string  $key  The storage entry identifier.
38
	 *
39
	 * @return  CacheItemInterface
40
	 *
41
	 * @since   1.0
42
	 */
43 3
	public function getItem($key)
44
	{
45 3
		return new Item($key);
46
	}
47
48
	/**
49
	 * Method to remove a storage entry for a key.
50
	 *
51
	 * @param   string  $key  The storage entry identifier.
52
	 *
53
	 * @return  boolean
54
	 *
55
	 * @since   1.0
56
	 */
57 2
	public function deleteItem($key)
58
	{
59 2
		return true;
60
	}
61
62
	/**
63
	 * Persists a cache item immediately.
64
	 *
65
	 * @param   CacheItemInterface  $item  The cache item to save.
66
	 *
67
	 * @return  static  The invoked object.
68
	 */
69 3
	public function save(CacheItemInterface $item)
70
	{
71 3
		return true;
72
	}
73
74
	/**
75
	 * Method to determine whether a storage entry has been set for a key.
76
	 *
77
	 * @param   string  $key  The storage entry identifier.
78
	 *
79
	 * @return  boolean
80
	 *
81
	 * @since   1.0
82
	 */
83 2
	public function hasItem($key)
84
	{
85 2
		return false;
86
	}
87
88
	/**
89
	 * Test to see if the CacheItemPoolInterface is available
90
	 *
91
	 * @return  boolean  True on success, false otherwise
92
	 *
93
	 * @since   __DEPLOY_VERSION__
94
	 */
95
	public static function isSupported()
96
	{
97
		return true;
98
	}
99
}
100