1 | <?php |
||
12 | class Registry |
||
13 | { |
||
14 | /** |
||
15 | * @var array |
||
16 | * @access private |
||
17 | */ |
||
18 | private $vars = []; |
||
19 | |||
20 | |||
21 | /** |
||
22 | * There be nay feckin wi' constructors on board this ship |
||
23 | * There be nay copyin' o' th'ship either |
||
24 | * This ship is a singleton! |
||
25 | */ |
||
26 | public function __construct(){} |
||
28 | |||
29 | |||
30 | /** |
||
31 | * Ahoy! There nay be boardin' without yer configuration |
||
32 | |||
33 | * @return Registry |
||
34 | */ |
||
35 | 46 | public static function ahoy(): Registry |
|
44 | |||
45 | /** |
||
46 | * What would you like us t' remember for you? |
||
47 | * @param $index |
||
48 | * @param $value |
||
49 | */ |
||
50 | 36 | public function set(string $index, $value) |
|
54 | |||
55 | /** |
||
56 | * You would like t' remember somethin'? |
||
57 | * @param string $index |
||
58 | * @return mixed |
||
59 | */ |
||
60 | 44 | public function get($index) |
|
64 | |||
65 | /** |
||
66 | * @return array |
||
67 | */ |
||
68 | 1 | public function getAll(): array |
|
72 | } |