Test Setup Failed
Push — master ( 3f4bf8...f5ce5c )
by La Teva Web
03:23
created

AbstractField::getStoredValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace LaTevaWeb\QueryUpdater\Field;
4
5
abstract class AbstractField
6
{
7
    protected $name;
8
    protected $value;
9
    protected $storedValue;
10
11
    private function __construct(string $name, $value = null, $storedValue = null)
12
    {
13
        $this->setName($name);
14
        $this->setValue($value);
15
        $this->setStoredValue($storedValue);
16
    }
17
18
    public static function field(string $name, $value = null, $storedValue = null): self
19
    {
20
        return new static($name, $value, $storedValue);
21
    }
22
23
    /**
24
     * @return string
25
     */
26
    public function getName(): string
27
    {
28
        return $this->name;
29
    }
30
31
    /**
32
     * @param string $name
33
     */
34
    public function setName(string $name): void
35
    {
36
        $this->name = $name;
37
    }
38
39
    /**
40
     * @return mixed
41
     */
42
    public function getStoredValue()
43
    {
44
        return $this->storedValue;
45
    }
46
47
    /**
48
     * @param mixed $storedValue
49
     */
50
    public function setStoredValue($storedValue): void
51
    {
52
        $this->storedValue = $storedValue;
53
    }
54
55
    abstract public function getValue();
56
57
    abstract public function setValue($value = null): void;
58
}
59