Index: trunk/phase3/maintenance/parserTests.inc |
— | — | @@ -270,8 +270,8 @@ |
271 | 271 | * Prints status updates on stdout and counts up the total |
272 | 272 | * number and percentage of passed tests. |
273 | 273 | * |
274 | | - * @param array of strings $filenames |
275 | | - * @return bool True if passed all tests, false if any tests failed. |
| 274 | + * @param $filenames Array of strings |
| 275 | + * @return Boolean: true if passed all tests, false if any tests failed. |
276 | 276 | */ |
277 | 277 | public function runTestsFromFiles( $filenames ) { |
278 | 278 | $this->recorder->start(); |
— | — | @@ -323,9 +323,12 @@ |
324 | 324 | * and compare the output against the expected results. |
325 | 325 | * Prints status and explanatory messages to stdout. |
326 | 326 | * |
327 | | - * @param string $input Wikitext to try rendering |
328 | | - * @param string $result Result to output |
329 | | - * @return bool |
| 327 | + * @param $desc String: test's description |
| 328 | + * @param $input String: wikitext to try rendering |
| 329 | + * @param $result String: result to output |
| 330 | + * @param $opts Array: test's options |
| 331 | + * @param $config String: overrides for global variables, one per line |
| 332 | + * @return Boolean |
330 | 333 | */ |
331 | 334 | public function runTest( $desc, $input, $result, $opts, $config ) { |
332 | 335 | if( $this->showProgress ) { |
— | — | @@ -405,9 +408,9 @@ |
406 | 409 | |
407 | 410 | /** |
408 | 411 | * Use a regex to find out the value of an option |
409 | | - * @param $key name of option val to retrieve |
| 412 | + * @param $key String: name of option val to retrieve |
410 | 413 | * @param $opts Options array to look in |
411 | | - * @param $defaults Default value returned if not found |
| 414 | + * @param $default Mixed: default value returned if not found |
412 | 415 | */ |
413 | 416 | private static function getOptionValue( $key, $opts, $default ) { |
414 | 417 | $key = strtolower( $key ); |
— | — | @@ -791,7 +794,8 @@ |
792 | 795 | /** |
793 | 796 | * Create a dummy uploads directory which will contain a couple |
794 | 797 | * of files in order to pass existence tests. |
795 | | - * @return string The directory |
| 798 | + * |
| 799 | + * @return String: the directory |
796 | 800 | */ |
797 | 801 | private function setupUploadDir() { |
798 | 802 | global $IP; |
— | — | @@ -880,7 +884,7 @@ |
881 | 885 | |
882 | 886 | /** |
883 | 887 | * Delete the specified files, if they exist. |
884 | | - * @param array $files full paths to files to delete. |
| 888 | + * @param $files Array: full paths to files to delete. |
885 | 889 | */ |
886 | 890 | private static function deleteFiles( $files ) { |
887 | 891 | foreach( $files as $file ) { |
— | — | @@ -892,7 +896,7 @@ |
893 | 897 | |
894 | 898 | /** |
895 | 899 | * Delete the specified directories, if they exist. Must be empty. |
896 | | - * @param array $dirs full paths to directories to delete. |
| 900 | + * @param $dirs Array: full paths to directories to delete. |
897 | 901 | */ |
898 | 902 | private static function deleteDirs( $dirs ) { |
899 | 903 | foreach( $dirs as $dir ) { |
— | — | @@ -912,8 +916,8 @@ |
913 | 917 | /** |
914 | 918 | * Print a happy success message. |
915 | 919 | * |
916 | | - * @param string $desc The test name |
917 | | - * @return bool |
| 920 | + * @param $desc String: the test name |
| 921 | + * @return Boolean |
918 | 922 | */ |
919 | 923 | protected function showSuccess( $desc ) { |
920 | 924 | if( $this->showProgress ) { |
— | — | @@ -926,10 +930,10 @@ |
927 | 931 | * Print a failure message and provide some explanatory output |
928 | 932 | * about what went wrong if so configured. |
929 | 933 | * |
930 | | - * @param string $desc The test name |
931 | | - * @param string $result Expected HTML output |
932 | | - * @param string $html Actual HTML output |
933 | | - * @return bool |
| 934 | + * @param $desc String: the test name |
| 935 | + * @param $result String: expected HTML output |
| 936 | + * @param $html String: actual HTML output |
| 937 | + * @return Boolean |
934 | 938 | */ |
935 | 939 | protected function showFailure( $desc, $result, $html ) { |
936 | 940 | if( $this->showFailure ) { |
— | — | @@ -956,11 +960,11 @@ |
957 | 961 | * Run given strings through a diff and return the (colorized) output. |
958 | 962 | * Requires writable /tmp directory and a 'diff' command in the PATH. |
959 | 963 | * |
960 | | - * @param string $input |
961 | | - * @param string $output |
962 | | - * @param string $inFileTail Tailing for the input file name |
963 | | - * @param string $outFileTail Tailing for the output file name |
964 | | - * @return string |
| 964 | + * @param $input String |
| 965 | + * @param $output String |
| 966 | + * @param $inFileTail String: tailing for the input file name |
| 967 | + * @param $outFileTail String: tailing for the output file name |
| 968 | + * @return String |
965 | 969 | */ |
966 | 970 | protected function quickDiff( $input, $output, $inFileTail='expected', $outFileTail='actual' ) { |
967 | 971 | $prefix = wfTempDir() . "/mwParser-" . mt_rand(); |
— | — | @@ -981,8 +985,8 @@ |
982 | 986 | /** |
983 | 987 | * Write the given string to a file, adding a final newline. |
984 | 988 | * |
985 | | - * @param string $data |
986 | | - * @param string $filename |
| 989 | + * @param $data String |
| 990 | + * @param $filename String |
987 | 991 | */ |
988 | 992 | private function dumpToFile( $data, $filename ) { |
989 | 993 | $file = fopen( $filename, "wt" ); |
— | — | @@ -994,8 +998,8 @@ |
995 | 999 | * Colorize unified diff output if set for ANSI color output. |
996 | 1000 | * Subtractions are colored blue, additions red. |
997 | 1001 | * |
998 | | - * @param string $text |
999 | | - * @return string |
| 1002 | + * @param $text String |
| 1003 | + * @return String |
1000 | 1004 | */ |
1001 | 1005 | protected function colorDiff( $text ) { |
1002 | 1006 | return preg_replace( |
— | — | @@ -1008,7 +1012,7 @@ |
1009 | 1013 | /** |
1010 | 1014 | * Show "Reading tests from ..." |
1011 | 1015 | * |
1012 | | - * @param String $path |
| 1016 | + * @param $path String |
1013 | 1017 | */ |
1014 | 1018 | public function showRunFile( $path ){ |
1015 | 1019 | print $this->term->color( 1 ) . |
— | — | @@ -1019,9 +1023,9 @@ |
1020 | 1024 | |
1021 | 1025 | /** |
1022 | 1026 | * Insert a temporary test article |
1023 | | - * @param string $name the title, including any prefix |
1024 | | - * @param string $text the article text |
1025 | | - * @param int $line the input line number, for reporting errors |
| 1027 | + * @param $name String: the title, including any prefix |
| 1028 | + * @param $text String: the article text |
| 1029 | + * @param $line Integer: the input line number, for reporting errors |
1026 | 1030 | */ |
1027 | 1031 | public function addArticle($name, $text, $line) { |
1028 | 1032 | $this->setupGlobals(); |
— | — | @@ -1045,7 +1049,8 @@ |
1046 | 1050 | * Steal a callback function from the primary parser, save it for |
1047 | 1051 | * application to our scary parser. If the hook is not installed, |
1048 | 1052 | * die a painful dead to warn the others. |
1049 | | - * @param string $name |
| 1053 | + * |
| 1054 | + * @param $name String |
1050 | 1055 | */ |
1051 | 1056 | public function requireHook( $name ) { |
1052 | 1057 | global $wgParser; |
— | — | @@ -1061,7 +1066,8 @@ |
1062 | 1067 | * Steal a callback function from the primary parser, save it for |
1063 | 1068 | * application to our scary parser. If the hook is not installed, |
1064 | 1069 | * die a painful dead to warn the others. |
1065 | | - * @param string $name |
| 1070 | + * |
| 1071 | + * @param $name String |
1066 | 1072 | */ |
1067 | 1073 | private function requireFunctionHook( $name ) { |
1068 | 1074 | global $wgParser; |
— | — | @@ -1077,8 +1083,8 @@ |
1078 | 1084 | * Run the "tidy" command on text if the $wgUseTidy |
1079 | 1085 | * global is true |
1080 | 1086 | * |
1081 | | - * @param string $text the text to tidy |
1082 | | - * @return string |
| 1087 | + * @param $text String: the text to tidy |
| 1088 | + * @return String |
1083 | 1089 | * @static |
1084 | 1090 | */ |
1085 | 1091 | private function tidy( $text ) { |
— | — | @@ -1145,8 +1151,8 @@ |
1146 | 1152 | /** |
1147 | 1153 | * Return ANSI terminal escape code for changing text attribs/color |
1148 | 1154 | * |
1149 | | - * @param string $color Semicolon-separated list of attribute/color codes |
1150 | | - * @return string |
| 1155 | + * @param $color String: semicolon-separated list of attribute/color codes |
| 1156 | + * @return String |
1151 | 1157 | */ |
1152 | 1158 | public function color( $color ) { |
1153 | 1159 | global $wgCommandLineDarkBg; |
— | — | @@ -1157,7 +1163,7 @@ |
1158 | 1164 | /** |
1159 | 1165 | * Return ANSI terminal escape code for restoring default text attributes |
1160 | 1166 | * |
1161 | | - * @return string |
| 1167 | + * @return String |
1162 | 1168 | */ |
1163 | 1169 | public function reset() { |
1164 | 1170 | return $this->color( 0 ); |
— | — | @@ -1451,8 +1457,9 @@ |
1452 | 1458 | |
1453 | 1459 | /** |
1454 | 1460 | * Record an individual test item's success or failure to the db |
1455 | | - * @param string $test |
1456 | | - * @param bool $result |
| 1461 | + * |
| 1462 | + * @param $test String |
| 1463 | + * @param $result Boolean |
1457 | 1464 | */ |
1458 | 1465 | function record( $test, $result ) { |
1459 | 1466 | parent::record( $test, $result ); |
— | — | @@ -1485,11 +1492,11 @@ |
1486 | 1493 | |
1487 | 1494 | /** |
1488 | 1495 | * Inform a CodeReview instance that we've started or completed a test run... |
1489 | | - * @param $remote array: info on remote target |
| 1496 | + * |
1490 | 1497 | * @param $status string: "running" - tell it we've started |
1491 | 1498 | * "complete" - provide test results array |
1492 | 1499 | * "abort" - something went horribly awry |
1493 | | - * @param $data array of test name => true/false |
| 1500 | + * @param $results array of test name => true/false |
1494 | 1501 | */ |
1495 | 1502 | function ping( $status, $results=false ) { |
1496 | 1503 | global $wgParserTestRemote, $IP; |