18 $this->originalContent=$content;
19 $this->description=[];
24 $this->lines=\explode(
"\n", $this->originalContent);
25 foreach ($this->lines as $line){
27 $line=\preg_replace(
"@^(\*\*\/)|(\/\*\*)|(\*)|(\/)@i",
"", $line);
31 if(\preg_match(
"@^\@(.*?)\ @i", $line,$matches)){
32 $this->
addInArray($this->lines, $matches[1], \preg_replace(
"@^\@".$matches[1].
"(.*?)\ @i",
"$1", $line));
35 $this->description[]=$line;
39 $this->description=\array_diff($this->description, [
"",
"/"]);
44 return \sizeof($this->lines)==0;
48 if(!isset($array[$key])){
51 $array[$key][]=$value;
59 if(isset($this->lines[$partKey]))
60 return $this->lines[$partKey];
66 if(\
sizeof($descs)>0){
67 $descs=self::getElementsAsHtml($descs,null);
68 if(isset($separator)){
69 return \implode($separator, $descs);
81 return \array_merge($this->
getPart(
"param"),$this->
getPart(
"return"));
85 return $this->
getPart(
"return");
105 foreach ($elements as $element){
106 $result[]=$this->formater->replaceAll($element);
108 if(isset($separator))
109 return \implode($separator, $result);
114 if(\class_exists($classname)){
115 $reflect=new \ReflectionClass($classname);
121 if(\class_exists($classname)){
122 if(\method_exists($classname, $method)){
123 $reflect=new \ReflectionMethod($classname,$method);
static docMethodParser($classname, $method)
getMethodParamsAsHtml($separator=NULL)
getElementsAsHtml($elements, $separator="<br>")
getDescriptionAsHtml($separator="<br>")
static docClassParser($classname)
getMethodParamsReturnAsHtml($separator=NULL)
addInArray(&$array, $key, $value)
getMethodReturnAsHtml($separator="<br>")
__construct($content, DocFormater $formater=null)
static startswith($hay, $needle)