Completed
Push — master ( 664709...70cc89 )
by Adam
05:40
created

IStorage

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 45
ccs 2
cts 2
cp 1
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
set() 0 1 ?
get() 0 1 ?
clear() 0 1 ?
clearAll() 0 1 ?
1
<?php
2
/**
3
 * IStorage.php
4
 *
5
 * @copyright      More in license.md
6
 * @license        http://www.ipublikuj.eu
7
 * @author         Adam Kadlec http://www.ipublikuj.eu
8
 * @package        iPublikuj:FlashMessages!
9
 * @subpackage     Storage
10
 * @since          2.1.0
11
 *
12
 * @date           26.07.14
13
 */
14
15
declare(strict_types = 1);
16
17
namespace IPub\FlashMessages\Storage;
18
19
use Nette;
20
use Nette\Http;
21
22
/**
23
 * Confirmer status storage interface
24
 *
25
 * @package        iPublikuj:FlashMessages!
26
 * @subpackage     Storage
27
 *
28
 * @author         Adam Kadlec <[email protected]>
29
 */
30 1
interface IStorage
31
{
32
	/**
33
	 * Define session keys
34
	 */
35
	const KEY_MESSAGES = 'messages';
36
	const KEY_IMPORTANT = 'important';
37
38
	/**
39
	 * Stores the given ($key, $value) pair, so that future calls to
40
	 * get($key) return $value. This call may be in another request.
41
	 *
42
	 * @param string $key
43
	 * @param mixed $value
44
	 *
45
	 * @return void
46
	 */
47
	function set(string $key, $value);
48
49
	/**
50
	 * Get the data for $key
51
	 *
52
	 * @param string $key    The key of the data to retrieve
53
	 * @param mixed $default The default value to return if $key is not found
54
	 *
55
	 * @return mixed
56
	 */
57
	function get(string $key, $default = FALSE);
58
59
	/**
60
	 * Clear the data with $key from the persistent storage
61
	 *
62
	 * @param string $key
63
	 *
64
	 * @return void
65
	 */
66
	function clear(string $key);
67
68
	/**
69
	 * Clear all data from the persistent storage
70
	 *
71
	 * @return void
72
	 */
73
	function clearAll();
74
}
75