| Total Complexity | 9 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Coverage | 15.38% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class midcom_response_xml extends midcom_response |
||
| 15 | { |
||
| 16 | 1 | public function __construct() |
|
| 17 | { |
||
| 18 | 1 | parent::__construct(); |
|
| 19 | 1 | $this->headers->set('Content-type', 'text/xml; charset=' . $this->encoding); |
|
| 20 | 1 | } |
|
| 21 | |||
| 22 | /** |
||
| 23 | * Sends the response to the client and shuts down the environment |
||
| 24 | */ |
||
| 25 | public function sendContent() |
||
| 26 | { |
||
| 27 | echo '<?xml version="1.0" encoding="' . $this->encoding . '" standalone="yes"?>' . "\n"; |
||
| 28 | echo "<response>\n"; |
||
| 29 | |||
| 30 | foreach ($this->_data as $field => $value) { |
||
| 31 | echo $this->_render_tag($field, $value); |
||
| 32 | } |
||
| 33 | |||
| 34 | echo "</response>\n"; |
||
| 35 | } |
||
| 36 | |||
| 37 | private function _render_tag($field, $value) |
||
| 61 | } |
||
| 62 | } |
||
| 63 |