Doxygen: how to describe class member variables in php? -


i'm trying use doxygen parse php code xml output. doxygen not parse description of class member variables.

here sample php file:

<?php class {     /**       * id on page.       *       * @var integer       */     var $id = 1; } ?> 

note comment has brief description , variable type. here xml got source:

<?xml version='1.0' encoding='utf-8' standalone='no'?> <doxygen xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"    xsi:nonamespaceschemalocation="compound.xsd" version="1.7.2">   <compounddef id="class_a" kind="class" prot="public"> <compoundname>a</compoundname>   <sectiondef kind="public-attrib">   <memberdef kind="variable" id="class_a_1ae97941710d863131c700f069b109991e" prot="public" static="no" mutable="no">     <type></type>     <definition>$id</definition>     <argsstring></argsstring>     <name>$id</name>     <initializer> 1</initializer>     <briefdescription>     </briefdescription>     <detaileddescription>     </detaileddescription>     <inbodydescription>     </inbodydescription>     <location file="c:/projects/version6-7/asprunner/php/source/classes/a.php" line="11" bodyfile="c:/projects/version6-7/asprunner/php/source/classes/a.php" bodystart="11" bodyend="-1"/>   </memberdef>   </sectiondef> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <location file="c:/projects/version6-7/asprunner/php/source/classes/a.php" line="5" bodyfile="c:/projects/version6-7/asprunner/php/source/classes/a.php" bodystart="4" bodyend="12"/> <listofallmembers>   <member refid="class_a_1ae97941710d863131c700f069b109991e" prot="public" virt="non-virtual"><scope>a</scope><name>$id</name></member> </listofallmembers>   </compounddef> </doxygen> 

neither description or type parsed. how can fix this?

i using input filter insert typehints @var annotation inline variable declaration, , remove @var annotation has different meaning in doxygen. more info, see bug #626105.

as doxygen uses c-like parser, when input filter run can recognize types.

<?php $source = file_get_contents($argv[1]);  $regexp = '#\@var\s+([^\s]+)([^/]+)/\s+(var|public|protected|private)\s+(\$[^\s;=]+)#'; $replac = '${2} */ ${3} ${1} ${4}'; $source = preg_replace($regexp, $replac, $source);  echo $source; 

this quick hack, , have bugs, works code:

doxygen @var php

you can enable input filter input_filter option in doxyfile. save code above file named php_var_filter.php , set filter value "php php_var_filter.php".


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -