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

Storage   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A set() 0 4 1
A get() 0 4 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
}