Merge "Fixes to Special:Mostlinkedcategories."
[lhc/web/wiklou.git] / maintenance / mwdoc-filter.php
1 <?php
2 /**
3 * Doxygen filter to show correct member variable types in documentation.
4 *
5 * Should be filled in doxygen INPUT_FILTER as "php mwdoc-filter.php"
6 *
7 * Original source code by Goran Rakic
8 * http://blog.goranrakic.com/
9 * http://stackoverflow.com/questions/4325224
10 *
11 * @file
12 */
13
14 $source = file_get_contents( $argv[1] );
15 $regexp = '#\@var\s+([^\s]+)([^/]+)/\s+(var|public|protected|private)\s+(\$[^\s;=]+)#';
16 $replac = '${2} */ ${3} ${1} ${4}';
17 $source = preg_replace($regexp, $replac, $source);
18
19 echo $source;