forked from yiisoft/yii2-authclient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStateStorageInterface.php
45 lines (41 loc) · 1.34 KB
/
StateStorageInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yii\authclient;
/**
* StateStorageInterface is an interface for Auth client state storage.
*
* Herein 'state' means a named variable, which is persistent between different requests.
*
* Note: in order to function correctly state storage should vary depending on application session,
* e.g. different web users should not share state with the same name.
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.1
*/
interface StateStorageInterface
{
/**
* Adds a state variable.
* If the specified name already exists, the old value will be overwritten.
* @param string $key variable name
* @param mixed $value variable value
*/
public function set($key, $value);
/**
* Returns the state variable value with the variable name.
* If the variable does not exist, the `$defaultValue` will be returned.
* @param string $key the variable name
* @return mixed the variable value, or `null` if the variable does not exist.
*/
public function get($key);
/**
* Removes a state variable.
* @param string $key the name of the variable to be removed
* @return boolean success.
*/
public function remove($key);
}