/** This is where you output the object you receive, the parameter given is an instance of stdClass. */ public function action($stdClassObject) { header("Content-type: application/xml"); echo XMLSerializer::generateXML($stdClassObject, null, array("stdclass" => "object")) . "</root>"; }
/** * writes an issue to STDOUT (console/command prompt/log/etc.) * * @param CodeIssue $issues an issue to write to StdOUT */ private function pushToStdIO(array $issues) { foreach ($issues as $issue) { if ($this->isFirst) { echo "<issue>" . XMLSerializer::generateXML($issue) . "</issue>"; $this->isFirst = false; continue; } echo "\n\t<issue>" . XMLSerializer::generateXML($issue) . "</issue>"; } }