changed git call from https to git readonly
[atutor.git] / mods / phpdoc / PHPDoc / xmlexporter / PhpdocXMLWarningExporter.php
1 <?php\r
2 /**\r
3 * Exports a list of documentation warnings found by phpdoc\r
4\r
5 */ \r
6 class PhpdocXMLWarningExporter extends PhpdocXMLExporter {\r
7         \r
8         /**\r
9         * Attributes of a warning container.\r
10         * @var  array\r
11         */\r
12         var $warningAttributes = array(\r
13                                                                                                                                         "name"                          => "CDATA",\r
14                                                                                                                                         "type"                          => "CDATA",\r
15                                                                                                                                         "elementtype"   => "CDATA"\r
16                                                                                                                                 );\r
17         \r
18         var $fileprefix = "warnings_";\r
19         \r
20         function PhpdocXMLWarningExporter() {\r
21                 $this->PhpdocXMLExporter();\r
22         } // end constructor\r
23         \r
24         function create() {\r
25 \r
26                 reset($this->result);\r
27                 while (list($file, $warnings)=each($this->result)) {\r
28                         \r
29                         $this->xmlwriter->startElement("warnings", "", array("file"     => array( "type"        => "CDATA", "value"     => $file)));\r
30                         \r
31                         reset($warnings);\r
32                         while (list($type, $warning)=each($warnings)) {\r
33                         \r
34                                 reset($warning);\r
35                                 while (list($k, $data)=each($warning)) {\r
36                                         $data["elementtype"] = $type;\r
37                                         $this->xmlwriter->addElement("warning", $data["msg"], $this->getAttributes($data, $this->warningAttributes));\r
38                                 }\r
39                                         \r
40                         }\r
41                         \r
42                         $this->xmlwriter->endElement("warnings");\r
43                         \r
44                 }\r
45                 \r
46         } // end function create\r
47         \r
48 } // end class PhpdocXMLWarningExporter\r
49 ?>