File: PhpdocWarning.php

package info (click to toggle)
php4 4.0.3pl1-0potato3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 15,168 kB
  • ctags: 20,556
  • sloc: ansic: 155,237; php: 10,827; sh: 9,608; yacc: 1,874; lex: 1,742; makefile: 788; java: 424; awk: 359; cpp: 335; perl: 181; xml: 57
file content (64 lines) | stat: -rw-r--r-- 1,780 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**
* Container for all kind of Warnings the parser/analyser recognizes
* 
* The base of the report generator module is this container. It's currently 
* pretty simple and will change later on...
*/
class PhpdocWarning extends PhpdocObject {
	
	/**
	* Hash of documentation failures.
	* @var	array	
	*/
	var $doc_warnings = array();
	
	/**
	* Counter containing the number of documentation warnings.
	* @var	int
	* @see	getNumDocWarnings(), getNumWarnings()
	*/
	var $num_doc_warnings = 0;
	
	/**
	* Adds a warning to the list of class documentation failures.
	* @param	string	Name of the file that containts the error
	* @param	string	Kind of the element that caused the error: module, class, function, variable, use, const
	* @param	string	Name of the class/function/... that caused the warning
	* @param	string	Warning message itself
	* @para,	string	Type of the error: missing, mismatch, syntax, ...
	* @access	public
	* @see	addDocWarning()
	*/
	function addDocWarning($file, $elementtype, $elementname, $warning, $type="missing") {

		$this->doc_warnings[$file][$elementtype][] =	array(
																												"name"	=> $elementname,
																												"type"	=> $type,
																												"msg"		=> $warning
																												);
		$this->num_doc_warnings++;
		
	} // end func addDocWarning

	/**
	* Returns a list of warnings.
	*
	* @return	array	$warnings
	* @access	public
	*/		
	function getWarnings() {
		return $this->doc_warnings;
	} // end func getParserWarnings
	
	/**
	* Returns the total number of documentation warnings.
	* @access	public
	* @see	getNumParserWarnings(), getNumWarnings()
	*/
	function getNumDocWarnings() {
		return $this->num_doc_warnings;
	} // end func getNumDocWarnings
	
} // end class PhpdocWarning
?>