| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | 3 | public function generate() : string |
|
| 11 | { |
||
| 12 | 3 | $xml = new \XMLWriter; |
|
| 13 | 3 | $xml->openMemory(); |
|
| 14 | 3 | $xml->setIndent(true); |
|
| 15 | 3 | $xml->setIndentString(sprintf("\t")); |
|
| 16 | |||
| 17 | 3 | $xml->startElement('environmentVariables'); |
|
| 18 | |||
| 19 | 3 | foreach ($this->keys as $key => $match) { |
|
| 20 | 3 | $xml->startElement('environmentVariable'); |
|
| 21 | 3 | $xml->writeAttribute('name', $match); |
|
| 22 | 3 | $xml->writeAttribute('value', $this->values[$key]); |
|
| 23 | 3 | $xml->endElement(); |
|
| 24 | 3 | } |
|
| 25 | |||
| 26 | 3 | $xml->endElement(); |
|
| 27 | |||
| 28 | 3 | return trim($xml->outputMemory()); |
|
| 29 | } |
||
| 30 | } |
||
| 31 |