Passed
Push — master ( 22152a...8c8825 )
by Walter
28s
created

EmptyStorage   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 24
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A clear() 0 4 1
A read() 0 4 1
A write() 0 4 1
1
<?php
2
3
namespace PhpAbTestAsset;
4
5
use PhpAb\TestInterface;
6
use PhpAb\Storage\StorageInterface;
7
8
class EmptyStorage implements StorageInterface
9
{
10
    private $choice;
11
12
    public function __construct($choice = null)
13
    {
14
        $this->choice = $choice;
15
    }
16
17
    public function clear(TestInterface $test)
18
    {
19
        $this->choice = null;
20
    }
21
22
    public function read(TestInterface $test)
23
    {
24
        return $this->choice;
25
    }
26
27
    public function write(TestInterface $test, $choice)
28
    {
29
        $this->choice = $choice;
30
    }
31
}
32