Skip to content

Commit

Permalink
Throw exception if XML object cannot convert to string
Browse files Browse the repository at this point in the history
  • Loading branch information
shanethehat committed Jun 26, 2015
1 parent 84c7b61 commit 21ce8c4
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,13 @@ private function moduleFileExists()

private function getIndentedXml(\SimpleXMLElement $xml)
{
return $this->formatter->format($xml->asXML());
$xmlText = $xml->asXML();

if (false === $xmlText) {
throw new \RuntimeException('Failed to convert XML object to string');
}

return $this->formatter->format($xmlText);
}

/**
Expand Down

0 comments on commit 21ce8c4

Please sign in to comment.