Completed
Push — master ( 18b606...1191a0 )
by yuuki
04:00
created

FixData   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 48
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 4 1
A offsetExists() 0 4 1
A offsetGet() 0 4 1
A offsetSet() 0 4 1
A offsetUnset() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Ytake\PrestoClient;
5
6
/**
7
 * Class FixData
8
 */
9
final class FixData implements \ArrayAccess
10
{
11
    /**
12
     * @param string $column
13
     * @param        $value
14
     */
15
    public function add(string $column, $value)
16
    {
17
        $this->$column = $value;
18
    }
19
20
    /**
21
     * @param mixed $offset
22
     *
23
     * @return bool
24
     */
25
    public function offsetExists($offset)
26
    {
27
        return isset($this->$offset);
28
    }
29
30
    /**
31
     * @param string $offset
32
     *
33
     * @return mixed|null
34
     */
35
    public function offsetGet($offset)
36
    {
37
        return $this->$offset ?? null;
38
    }
39
40
    /**
41
     * @param mixed $offset
42
     * @param mixed $value
43
     */
44
    public function offsetSet($offset, $value)
45
    {
46
        $this->$offset = $value;
47
    }
48
49
    /**
50
     * @param string $offset
51
     */
52
    public function offsetUnset($offset)
53
    {
54
        unset($this->$offset);
55
    }
56
}
57