wiki.techinc.nl/maintenance/mwdoc-filter.php
Alexandre Emsenhuber 73ae67c6ed Improve documentation of maintenance scripts.
Change-Id: I557f85e8526a3e4b48107fbf299ff39f6af1ac12
2012-08-05 12:00:37 +02:00

19 lines
524 B
PHP

<?php
/**
* Doxygen filter to show correct member variable types in documentation.
*
* Should be filled in doxygen INPUT_FILTER as "php mwdoc-filter.php"
*
* Original source code by Goran Rakic
* http://blog.goranrakic.com/
* http://stackoverflow.com/questions/4325224
*
* @file
*/
$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;