| Conditions | 3 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function build() |
||
| 19 | { |
||
| 20 | $messages = $this->command->getData(); |
||
| 21 | |||
| 22 | $xml = new SimpleXmlElement('<?xml version="1.0" encoding="UTF-8"?><body></body>'); |
||
| 23 | |||
| 24 | |||
| 25 | foreach ($messages as $message) { |
||
| 26 | $smsNode = $xml->addChild('SMS'); |
||
| 27 | array_walk($message, function ($value, $key) use ($smsNode) { |
||
| 28 | if (array_key_exists($key, $this->messageNodes)) { |
||
| 29 | $smsNode->addChild($this->messageNodes[$key], $value); |
||
| 30 | } |
||
| 31 | }); |
||
| 32 | } |
||
| 33 | |||
| 34 | return $xml->children(); |
||
| 35 | } |
||
| 36 | } |
||
| 37 |