MemoryStore   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 40
rs 10
c 1
b 0
f 0
ccs 7
cts 7
cp 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A read() 0 4 1
A write() 0 4 1
A __construct() 0 6 2
1
<?php namespace Arcanedev\Settings\Stores;
2
3
use Arcanedev\Settings\Bases\Store;
4
use Arcanedev\Settings\Contracts\Store as StoreContract;
5
6
/**
7
 * Class     MemoryStore
8
 *
9
 * @package  Arcanedev\Settings\Stores
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class MemoryStore extends Store implements StoreContract
13
{
14
    /* ------------------------------------------------------------------------------------------------
15
     |  Constructor
16
     | ------------------------------------------------------------------------------------------------
17
     */
18
    /**
19
     * Make the memory store instance.
20
     *
21
     * @param  array  $data
22
     */
23 45
    public function __construct(array $data = null)
24
    {
25 45
        if ($data) {
26 6
            $this->data = $data;
27 6
        }
28 45
    }
29
30
    /* ------------------------------------------------------------------------------------------------
31
     |  Other Functions
32
     | ------------------------------------------------------------------------------------------------
33
     */
34
    /**
35
     * {@inheritdoc}
36
     */
37 42
    protected function read()
38
    {
39 42
        return $this->data;
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     *
45
     * @codeCoverageIgnore
46
     */
47
    protected function write(array $data)
48
    {
49
        // Do nothing, John SNOW.
50
    }
51
}
52