Storage::push()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
nc 1
dl 0
loc 1
c 0
b 0
f 0
ccs 0
cts 0
cp 0
1
<?php
2
3
namespace PhpConsole;
4
5
/**
6
 * Storage for postponed response data
7
 *
8
 * @package PhpConsole
9
 * @version 3.1
10
 * @link http://consle.com
11
 * @author Sergey Barbushin http://linkedin.com/in/barbushin
12
 * @copyright © Sergey Barbushin, 2011-2013. All rights reserved.
13
 * @license http://www.opensource.org/licenses/BSD-3-Clause "The BSD 3-Clause License"
14
 */
15
abstract class Storage {
16
17
	protected $keyLifetime = 60;
18
19
	/**
20
	 * Get postponed data from storage and delete
21
	 * @param string $key
22
	 * @return string
23
	 */
24
	abstract public function pop($key);
25
26
	/**
27
	 * Save postponed data to storage
28
	 * @param string $key
29
	 * @param string $data
30
	 */
31
	abstract public function push($key, $data);
32
33
	/**
34
	 * Set maximum key lifetime in seconds
35
	 * @param int $seconds
36
	 */
37 2
	public function setKeyLifetime($seconds) {
38 2
		$this->keyLifetime = $seconds;
39 2
	}
40
}
41