Total Complexity | 5 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class GetOpenOrdersResponse extends AbstractResponse implements IGetOpenOrdersResponseInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private string $category; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private string $nextPageCursor; |
||
23 | |||
24 | /** |
||
25 | * @var IGetTradingFeeRateResponseItemInterface[] |
||
26 | */ |
||
27 | private EntityCollection $list; |
||
28 | |||
29 | public function __construct(array $data) |
||
30 | { |
||
31 | $this->category = $data['category']; |
||
32 | $this->nextPageCursor = $data['nextPageCursor']; |
||
33 | |||
34 | $list = new EntityCollection(); |
||
35 | |||
36 | if (!empty($data['list'])) { |
||
37 | array_map(function ($item) use ($list) { |
||
38 | $list->push(ResponseDtoBuilder::make(GetOpenOrdersResponseItem::class, $item)); |
||
39 | }, $data['list']); |
||
40 | } |
||
41 | |||
42 | $this->list = $list; |
||
|
|||
43 | } |
||
44 | |||
45 | /** |
||
46 | * @return IGetOpenOrdersResponseItemInterface[] |
||
47 | */ |
||
48 | public function getOpenOrders(): array |
||
49 | { |
||
50 | return $this->list->all(); |
||
51 | } |
||
52 | |||
53 | public function getNextPageCursor(): string |
||
54 | { |
||
55 | return $this->nextPageCursor; |
||
56 | } |
||
57 | |||
58 | public function getCategory(): string |
||
61 | } |
||
62 | } |
||
63 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..