Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function __construct($xml, int $statusCode = 200, array $headers = [], $body = null, string $version = '1.1', string $reason = null) |
||
13 | { |
||
14 | if ($xml instanceof SimpleXMLElement) { |
||
15 | $body = $xml->asXML(); |
||
16 | } else { |
||
17 | $body = (string) $xml; |
||
18 | } |
||
19 | |||
20 | parent::__construct($statusCode, $headers + [ |
||
21 | 'Content-Type' => 'application/xml' |
||
22 | ], $body, $version, $reason); |
||
23 | } |
||
24 | } |