Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function __construct(array $data) |
||
18 | { |
||
19 | $collection = new EntityCollection(); |
||
20 | |||
21 | $this->topic = $data['topic']; |
||
22 | $this->type = $data['type']; |
||
23 | $this->timestamp = DateTimeHelper::makeFromTimestamp($data['ts']); |
||
24 | |||
25 | if (!empty($data['data'])) { |
||
26 | if (!empty($data['data'])) { |
||
27 | array_map(function ($item) use ($collection) { |
||
28 | $collection->push(ResponseDtoBuilder::make(KlineResponseItem::class, $item)); |
||
29 | }, $data['data']); |
||
30 | } |
||
31 | } |
||
32 | $this->data = $collection; |
||
33 | } |
||
57 |