Completed
Branch EDTR/master (f9130a)
by
unknown
46:59 queued 38:09
created

EnumBase::setValues()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace EventEspresso\core\services\graphql\enums;
4
5
/**
6
 * Class EnumBase
7
 * Description
8
 *
9
 * @package EventEspresso\core\services\graphql
10
 * @author  Manzoor Wani
11
 * @since   $VID:$
12
 */
13
abstract class EnumBase implements EnumInterface
14
{
15
16
    /**
17
     * @var string $name
18
     */
19
    protected $name = '';
20
21
    /**
22
     * @var string $description
23
     */
24
    protected $description = '';
25
26
    /**
27
     * @var array $values
28
     */
29
    protected $values = [];
30
31
    /**
32
     * EnumBase constructor.
33
     */
34
    public function __construct()
35
    {
36
        $this->setValues($this->getValues());
37
    }
38
39
40
    /**
41
     * @return array
42
     * @since $VID:$
43
     */
44
    abstract protected function getValues();
45
46
47
    /**
48
     * @return string
49
     */
50
    public function name()
51
    {
52
        return $this->name;
53
    }
54
55
56
    /**
57
     * @param string $name
58
     */
59
    protected function setName($name)
60
    {
61
        $this->name = $name;
62
    }
63
64
65
    /**
66
     * @return string
67
     */
68
    public function description()
69
    {
70
        return $this->description;
71
    }
72
73
74
    /**
75
     * @param string $description
76
     */
77
    protected function setDescription($description)
78
    {
79
        $this->description = $description;
80
    }
81
82
83
    /**
84
     * @return aray
85
     * @since $VID:$
86
     */
87
    public function values()
88
    {
89
        return (array) $this->values;
90
    }
91
92
93
    /**
94
     * @param array $values
95
     */
96
    protected function setValues(array $values)
97
    {
98
        $this->values = $values;
99
    }
100
}
101