| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 11 | protected function appendArticleData(SimpleXMLElement $data) |
|
| 34 | { |
||
| 35 | 11 | $data->addChild('article_data'); |
|
| 36 | |||
| 37 | 11 | foreach ($this->getItems()->all() as $pos => $item) { |
|
| 38 | 11 | if (!$item instanceof Item) { |
|
| 39 | 1 | throw new InvalidRequestException('All items must be of instance of ' . Item::class); |
|
| 40 | } |
||
| 41 | |||
| 42 | /* @noinspection DisconnectedForeachInstructionInspection */ |
||
| 43 | 10 | $data->article_data[0]->addChild('article'); |
|
| 44 | 10 | $data->article_data[0]->article[$pos]['articleid'] = $item->getId(); |
|
| 45 | 10 | $data->article_data[0]->article[$pos]['articlequantity'] = $item->getQuantity(); |
|
| 46 | 10 | $data->article_data[0]->article[$pos]['articlename'] = $item->getName(); |
|
| 47 | 10 | $data->article_data[0]->article[$pos]['articledescription'] = $item->getDescription(); |
|
| 48 | 10 | $data->article_data[0]->article[$pos]['articleprice'] = bcmul($item->getPriceNet(), 100, 0); |
|
| 49 | 10 | $data->article_data[0]->article[$pos]['articlepricegross'] = bcmul($item->getPrice(), 100, 0); |
|
| 50 | 10 | } |
|
| 51 | 10 | } |
|
| 52 | } |
||
| 53 |