-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRegistry.php
More file actions
63 lines (57 loc) · 1.14 KB
/
Copy pathRegistry.php
File metadata and controls
63 lines (57 loc) · 1.14 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/**
* Registre.
*
* @author Adrien <aimbert@solire.fr>
* @license CC by-nc http://creativecommons.org/licenses/by-nc/3.0/fr/
*/
namespace Solire\Lib;
/**
* Registre.
*
* @author Adrien <aimbert@solire.fr>
* @license CC by-nc http://creativecommons.org/licenses/by-nc/3.0/fr/
*/
class Registry
{
/**
* Contenu du registre.
*
* @var array
*/
private static $maps;
/**
* Instancie le registre (jamais utilisé).
*
* @ignore
*/
private function __construct()
{
}
/**
* Enregistre une variable dans le registre.
*
* @param string $key Nom/Code de l'élement à stocker
* @param mixed $value Valeur de l'élément à stocker
*
* @return void
*/
public static function set($key, $value)
{
self::$maps[$key] = $value;
}
/**
* Récupère une valeur du registre.
*
* @param string $key Nom/Code de l'élement stocké
*
* @return mixed
*/
public static function get($key)
{
if (isset(self::$maps[$key])) {
return self::$maps[$key];
}
return null;
}
}