| @@ 60-75 (lines=16) @@ | ||
| 57 | /** |
|
| 58 | * {@inheritdoc} |
|
| 59 | */ |
|
| 60 | public function convert($xmlDocument) |
|
| 61 | { |
|
| 62 | /** |
|
| 63 | * @var \DOMDocument $xmlDocument |
|
| 64 | */ |
|
| 65 | if (class_exists($this->streamClass)) { |
|
| 66 | ||
| 67 | $stream = fopen($this->options['stream'],'r+'); |
|
| 68 | fwrite($stream, $xmlDocument->saveXML($this->options['save_xml_options'])); |
|
| 69 | rewind($stream); |
|
| 70 | ||
| 71 | return new $this->streamClass($xmlDocument); |
|
| 72 | } |
|
| 73 | ||
| 74 | throw new \RuntimeException(sprintf('Provided StreamInterface implementation "%s" is not available on this system.', $this->streamClass)); |
|
| 75 | } |
|
| 76 | } |
|
| 77 | ||
| @@ 52-67 (lines=16) @@ | ||
| 49 | /** |
|
| 50 | * {@inheritdoc} |
|
| 51 | */ |
|
| 52 | public function convert($xmlDocument) |
|
| 53 | { |
|
| 54 | /** |
|
| 55 | * @var \SimpleXMLElement $xmlDocument |
|
| 56 | */ |
|
| 57 | if (class_exists($this->streamClass)) { |
|
| 58 | ||
| 59 | $stream = fopen($this->options['stream'],'r+'); |
|
| 60 | fwrite($stream, $xmlDocument->asXML()); |
|
| 61 | rewind($stream); |
|
| 62 | ||
| 63 | return new $this->streamClass($xmlDocument); |
|
| 64 | } |
|
| 65 | ||
| 66 | throw new \RuntimeException(sprintf('Provided StreamInterface implementation "%s" is not available on this system.', $this->streamClass)); |
|
| 67 | } |
|
| 68 | } |
|
| 69 | ||