IPReflectionProperty.class.php
1.83 KB
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
75
<?php
/**
* An extended reflection/documentation class for class properties
*
* This class extends the reflectionProperty class by also parsing the
* comment for javadoc compatible @tags and by providing help
* functions to generate a WSDL file. The class might also
* be used to generate a phpdoc on the fly
*
*@author KnowledgeTree Team
*@package Webservice
*@version Version 0.9
*@extends reflectionProperty
*/
class IPReflectionProperty extends reflectionProperty {
/** @var string Classname to whom this property belongs */
public $classname;
/** @var string Type description of the property */
public $type = "";
/** @var boolean Determens if the property is a private property */
public $isPrivate = false;
/** @var string */
public $description;
/** @var boolean */
public $optional = false;
/** @var boolean */
public $autoincrement = false;
/** @var string */
public $fullDescription = "";
/** @var string */
public $smallDescription = "";
/** @var string */
public $name = null;
/** @var string */
private $comment = null;
/**
* constructor. will initiate the commentParser
*
* @param string Class name
* @param string Property name
* @return void
*/
public function __construct($class, $property){
$this->classname = $class;
parent::__construct($class, $property);
$this->parseComment();
}
/**
*
* @param $annotationName String the annotation name
* @param $annotationClass String the annotation class
* @return void
*/
public function getAnnotation($annotationName, $annotationClass = null){
return IPPhpDoc::getAnnotation($this->comment, $annotationName, $annotationClass);
}
private function parseComment(){
// No getDocComment available for properties in php 5.0.3 :(
$this->comment = $this->getDocComment();
new IPReflectionCommentParser($this->comment, $this);
}
}
?>