changed git call from https to git readonly
[atutor.git] / mods / phpdoc / PHPDoc / warning / PhpdocWarning.php
1 <?php\r
2 /**\r
3 * Container for all kind of Warnings the parser/analyser recognizes\r
4\r
5 * The base of the report generator module is this container. It's currently \r
6 * pretty simple and will change later on...\r
7 *\r
8 * @version      $Id: PhpdocWarning.php,v 1.2 2000/12/03 22:37:38 uw Exp $\r
9 */\r
10 class PhpdocWarning extends PhpdocObject {\r
11         \r
12         /**\r
13         * Hash of documentation failures.\r
14         * @var  array   \r
15         */\r
16         var $doc_warnings = array();\r
17         \r
18         /**\r
19         * Counter containing the number of documentation warnings.\r
20         * @var  integer\r
21         * @see  getNumDocWarnings(), getNumWarnings()\r
22         */\r
23         var $num_doc_warnings = 0;\r
24         \r
25         /**\r
26         * Adds a warning to the list of class documentation failures.\r
27         * @param        string  Name of the file that containts the error\r
28         * @param        string  Kind of the element that caused the error: module, class, function, variable, use, const\r
29         * @param        string  Name of the class/function/... that caused the warning\r
30         * @param        string  Warning message itself\r
31         * @param        string  Type of the error: missing, mismatch, syntax, ...\r
32         * @access       public\r
33         * @see  addDocWarning()\r
34         */\r
35         function addDocWarning($file, $elementtype, $elementname, $warning, $type="missing") {\r
36 \r
37                 $this->doc_warnings[$file][$elementtype][] =    array(\r
38                                                                                                                                                                                                                                 "name"  => $elementname,\r
39                                                                                                                                                                                                                                 "type"  => $type,\r
40                                                                                                                                                                                                                                 "msg"           => $warning\r
41                                                                                                                                                                                                                                 );\r
42                 $this->num_doc_warnings++;\r
43                 \r
44         } // end func addDocWarning\r
45 \r
46         /**\r
47         * Returns a list of warnings.\r
48         *\r
49         * @return       array   $warnings\r
50         * @access       public\r
51         */              \r
52         function getWarnings() {\r
53                 return $this->doc_warnings;\r
54         } // end func getParserWarnings\r
55         \r
56         /**\r
57         * Returns the total number of documentation warnings.\r
58         * @access       public\r
59         * @see  getNumParserWarnings(), getNumWarnings()\r
60         */\r
61         function getNumDocWarnings() {\r
62                 return $this->num_doc_warnings;\r
63         } // end func getNumDocWarnings\r
64         \r
65 } // end class PhpdocWarning\r
66 ?>