| Total Complexity | 5 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class GetOrderListResponse extends AbstractResponse implements IGetOrderListResponseInterface |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * Product type |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | private string $category; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Cursor. Used to pagination |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | private string $nextPageCursor; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var IGetOrderListResponseItemInterface[] |
||
| 28 | */ |
||
| 29 | private $list; |
||
| 30 | |||
| 31 | public function __construct(array $data) |
||
| 32 | { |
||
| 33 | $this->category = $data['category']; |
||
| 34 | $this->nextPageCursor = $data['nextPageCursor']; |
||
| 35 | |||
| 36 | $list = new EntityCollection(); |
||
| 37 | |||
| 38 | if (!empty($data['list'])) { |
||
| 39 | array_map(function ($item) use ($list) { |
||
| 40 | $list->push(ResponseDtoBuilder::make(GetOrderListResponseItem::class, $item)); |
||
| 41 | }, $data['list']); |
||
| 42 | } |
||
| 43 | |||
| 44 | $this->list = $list; |
||
|
|
|||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @return IGetOpenOrdersResponseItemInterface[] |
||
| 49 | */ |
||
| 50 | public function getOrderList(): array |
||
| 51 | { |
||
| 52 | return $this->list->all(); |
||
| 53 | } |
||
| 54 | |||
| 55 | public function getNextPageCursor(): string |
||
| 58 | } |
||
| 59 | |||
| 60 | public function getCategory(): string |
||
| 63 | } |
||
| 64 | } |
||
| 65 |
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..