| Total Complexity | 9 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class Receipt |
||
| 9 | { |
||
| 10 | private $data; |
||
| 11 | private $products; |
||
| 12 | |||
| 13 | public function __construct(string $json) |
||
| 14 | { |
||
| 15 | $this->data = json_decode($json); |
||
| 16 | $this->products = new ProductCollection($this->data->content->items); |
||
| 17 | } |
||
| 18 | |||
| 19 | public function getProducts():ProductCollection |
||
| 20 | { |
||
| 21 | return $this->products; |
||
| 22 | } |
||
| 23 | |||
| 24 | public function getAddress():?string |
||
| 25 | { |
||
| 26 | return $this->data->content->retailPlaceAddress ?? $this->data->address ?? null; |
||
| 27 | } |
||
| 28 | |||
| 29 | public function getShopName():?string |
||
| 30 | { |
||
| 31 | return $this->data->content->user ?? null; |
||
| 32 | } |
||
| 33 | |||
| 34 | public function getShopInn() :int |
||
| 37 | } |
||
| 38 | |||
| 39 | public function getCashierName() :?string |
||
| 40 | { |
||
| 41 | return $this->data->content->operator ?? null; |
||
| 42 | } |
||
| 43 | |||
| 44 | public function getTotalSum():int |
||
| 45 | { |
||
| 46 | return $this->data->content->totalSum; |
||
| 47 | } |
||
| 48 | |||
| 49 | public function getKktRegId() :string |
||
| 50 | { |
||
| 51 | return $this->data->content->kktRegId; |
||
| 52 | } |
||
| 53 | |||
| 54 | public function getDataTimeString(): string |
||
| 58 | } |
||
| 59 | } |
||
| 60 |