3 * Doxygen filter to show correct member variable types in documentation.
5 * Should be filled in doxygen INPUT_FILTER as "php mwdoc-filter.php"
7 * Original source code by Goran Rakic
8 * http://blog.goranrakic.com/
9 * http://stackoverflow.com/questions/4325224
14 if ( PHP_SAPI
!= 'cli' ) {
15 die( "This filter can only be run from the command line.\n" );
18 $source = file_get_contents( $argv[1] );
25 // Any text or line(s) between type hint and '/' closing the comment
26 // (includes the star of "*/"). Descriptions containing a slash
27 // are not supported. Those will have to to be rewritten to have their
28 // description *before* the @var:
30 // * Description with / in it.
35 // * @var array Description with / in it.
40 . '(var|public|protected|private)'
45 $replac = '${2}/ ${3} ${1} ${4}';
46 $source = preg_replace( $regexp, $replac, $source );