Completed
Push — master ( d1373b...6613a6 )
by Igor
03:16
created

Storage::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * @license MIT
4
 * @author Igor Sorokin <[email protected]>
5
 */
6
namespace Dspbee\Core;
7
8
/**
9
 * Static key => value storage.
10
 *
11
 * Class Application
12
 * @package Dspbee\Core
13
 */
14
class Storage
15
{
16
    /**
17
     * Save data in storage.
18
     *
19
     * @param string $key
20
     * @param mixed $value
21
     */
22
    public static function set($key, $value)
23
    {
24
        self::$storage[$key] = $value;
25
    }
26
27
    /**
28
     * Get data by key.
29
     *
30
     * @param string $key
31
     * @return mixed|null
32
     */
33
    public static function get($key)
34
    {
35
        return self::$storage[$key] ?? null;
36
    }
37
38
    private static $storage;
39
}