CustomField   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 31
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A toAmoArray() 0 9 1
1
<?php
2
3
namespace mb24dev\AmoCRM\Entity;
4
5
/**
6
 * Class CustomField
7
 * @package mb24dev\AmoCRM\Entity
8
 */
9
class CustomField implements AmoEntityInterface
10
{
11
    private $id;
12
    private $values;
13
14
    /**
15
     * CustomField constructor.
16
     * @param $id
17
     * @param $values
18
     */
19
    public function __construct($id, $values)
20
    {
21
        $this->id = $id;
22
        $this->values = $values;
23
    }
24
25
    /**
26
     * @return array
27
     */
28
    public function toAmoArray()
29
    {
30
        return [
31
            'id' => $this->id,
32
            'values' => array_map(function (Value $value) {
33
                return $value->toAmoArray();
34
            }, $this->values)
35
        ];
36
    }
37
38
39
}