Completed
Push — master ( 24802e...2ba5bb )
by Walter
02:16
created

Storage::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * This file is part of phpab/phpab. (https://github.com/phpab/phpab)
4
 *
5
 * @link https://github.com/phpab/phpab for the canonical source repository
6
 * @copyright Copyright (c) 2015-2016 phpab. (https://github.com/phpab/)
7
 * @license https://raw.githubusercontent.com/phpab/phpab/master/LICENSE.md MIT
8
 */
9
10
namespace PhpAb\Storage;
11
12
use PhpAb\Storage\Adapter\AdapterInterface;
13
14
/**
15
 * {@inheritDoc}
16
 */
17
class Storage implements StorageInterface
18
{
19
    /**
20
     * @var AdapterInterface
21
     */
22
    private $adapter;
23
24
    /**
25
     * @param AdapterInterface $adpterInterface
26
     */
27 14
    public function __construct(AdapterInterface $adpterInterface)
28
    {
29 14
        $this->adapter = $adpterInterface;
30 14
    }
31
32
    /**
33
     * {@inheritDoc}
34
     */
35 13
    public function has($identifier)
36
    {
37 13
        return $this->adapter->has($identifier);
38
    }
39
40
    /**
41
     * {@inheritDoc}
42
     */
43 12
    public function get($identifier)
44
    {
45 12
        return $this->adapter->get($identifier);
46
    }
47
48
    /**
49
     * {@inheritDoc}
50
     */
51 11
    public function set($identifier, $participation)
52
    {
53 11
        $this->adapter->set($identifier, $participation);
54 11
    }
55
56
    /**
57
     * {@inheritDoc}
58
     */
59 6
    public function clear()
60
    {
61 6
        return $this->adapter->clear();
62
    }
63
}
64