Value::toAmoArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace mb24dev\AmoCRM\Entity;
4
5
/**
6
 * Class Value
7
 *
8
 * @package mb24dev\AmoCRM\Entity
9
 */
10
class Value implements AmoEntityInterface
11
{
12
    private $value;
13
    private $enum;
14
    /**
15
     * @var null
16
     */
17
    private $subtype;
18
19
    /**
20
     * Value constructor.
21
     *
22
     * @param      $value
23
     * @param      $enum
24
     * @param null $subtype
25
     */
26
    public function __construct($value, $enum = null, $subtype = null)
27
    {
28
        $this->value = $value;
29
        $this->enum = $enum;
30
        $this->subtype = $subtype;
31
    }
32
33
    /**
34
     * @return array
35
     */
36
    public function toAmoArray()
37
    {
38
        return [
39
            'value' => $this->value,
40
            'enum' => $this->enum,
41
            'subtype' => $this->subtype,
42
        ];
43
    }
44
}
45