File: PhpdocUseParser.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 (74 lines) | stat: -rw-r--r-- 1,752 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
65
66
67
68
69
70
71
72
73
74
<?php
/**
* Extracts use statements (include and friends) an thheir documentation from php code.
* @author	Ulf Wendel <ulf.wendel@redsys.de>
* @version 0.1alpha
*/
class PhpdocUseParser extends PhpdocParserCore {

	/**
	* Structure of an empty use entry.
	* @var	array
	*/
	var $emptyUse = array(
													"type"	=> "",
													"file"	=> "",
													"undoc"	=> true
											);
											

	/**
	* List of allowed tags in use doc comments.
	* @var	array
	*/												
	var $useTags = array(
												"return"			=> true,
												
												"see"					=> true,
												"link"				=> true,
												
												"authhor"			=> true,
												"copyright"		=> true,
												
												"version"			=> true,
												"since"				=> true,
												
												"deprecated"	=> true,
												"deprec"			=> true,
												
												"include"			=> true,

												"exclude"			=> true,												
												"magic"				=> true,
												"todo"				=> true
											);

	/**
	* Takes the result from getPhpdocParagraphs() and interprets it.
	* @param	array
	*/											
	function analyseUse($para) {
		
		$use = $this->emptyUse;
		$use["file"] = $para["file"];
		
		if (""!=$para["doc"]) {
		
			$use = $this->analyseTags($this->getTags($para["doc"]), $use, $this->useTags);
			
			list($msg, $use) = $this->checkParserErrors($use, "use (include and friends)");
			if (""!=$msg)
				$this->warn->addDocWarning($this->currentFile, "use", $use["file"], $msg, "mismatch");
				
			list($use["sdesc"], $use["desc"]) = $this->getDescription($para["doc"]);
			
			$use["undoc"] = false;
		}
		
		$use["type"] = $para["type"];

		return $use;
	} // end func analyseUse
	
} // end class PhpdocUseParser
?>