@@ -466,7 +466,7 @@ |
||
| 466 | 466 | |
| 467 | 467 | /** |
| 468 | 468 | * Get converted title. |
| 469 | - * @return string |
|
| 469 | + * @return boolean |
|
| 470 | 470 | */ |
| 471 | 471 | public function getTitle() { |
| 472 | 472 | return $this->mRuleTitle; |
@@ -32,6 +32,9 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public $mLang; |
| 34 | 34 | |
| 35 | + /** |
|
| 36 | + * @param Language $langobj |
|
| 37 | + */ |
|
| 35 | 38 | function __construct( $langobj ) { |
| 36 | 39 | $this->mLang = $langobj; |
| 37 | 40 | } |
@@ -54,7 +57,7 @@ discard block |
||
| 54 | 57 | |
| 55 | 58 | /** |
| 56 | 59 | * @param Title $t |
| 57 | - * @return mixed |
|
| 60 | + * @return string |
|
| 58 | 61 | */ |
| 59 | 62 | function convertTitle( $t ) { |
| 60 | 63 | return $t->getPrefixedText(); |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | |
| 146 | 146 | /** |
| 147 | 147 | * Get the title produced by the conversion rule. |
| 148 | - * @return string The converted title text |
|
| 148 | + * @return boolean The converted title text |
|
| 149 | 149 | */ |
| 150 | 150 | public function getConvRuleTitle() { |
| 151 | 151 | return $this->mConvRuleTitle; |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | /** |
| 208 | 208 | * Validate the variant |
| 209 | 209 | * @param string $variant The variant to validate |
| 210 | - * @return mixed Returns the variant if it is valid, null otherwise |
|
| 210 | + * @return string|null Returns the variant if it is valid, null otherwise |
|
| 211 | 211 | */ |
| 212 | 212 | public function validateVariant( $variant = null ) { |
| 213 | 213 | if ( $variant !== null && in_array( $variant, $this->mVariants ) ) { |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | /** |
| 220 | 220 | * Get the variant specified in the URL |
| 221 | 221 | * |
| 222 | - * @return mixed Variant if one found, false otherwise. |
|
| 222 | + * @return string|null Variant if one found, false otherwise. |
|
| 223 | 223 | */ |
| 224 | 224 | public function getURLVariant() { |
| 225 | 225 | global $wgRequest; |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | /** |
| 243 | 243 | * Determine if the user has a variant set. |
| 244 | 244 | * |
| 245 | - * @return mixed Variant if one found, false otherwise. |
|
| 245 | + * @return string|null Variant if one found, false otherwise. |
|
| 246 | 246 | */ |
| 247 | 247 | protected function getUserVariant() { |
| 248 | 248 | global $wgUser, $wgContLang; |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | /** |
| 277 | 277 | * Determine the language variant from the Accept-Language header. |
| 278 | 278 | * |
| 279 | - * @return mixed Variant if one found, false otherwise. |
|
| 279 | + * @return string|null Variant if one found, false otherwise. |
|
| 280 | 280 | */ |
| 281 | 281 | protected function getHeaderVariant() { |
| 282 | 282 | global $wgRequest; |
@@ -178,6 +178,10 @@ |
||
| 178 | 178 | echo "Copied $numRowsCopied rows\n"; |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | + /** |
|
| 182 | + * @param string $srcTable |
|
| 183 | + * @param string $dstTable |
|
| 184 | + */ |
|
| 181 | 185 | function copyExactMatch( $srcTable, $dstTable, $copyPos ) { |
| 182 | 186 | $numRowsCopied = 0; |
| 183 | 187 | $srcRes = $this->dbw->select( $srcTable, '*', array( 'log_timestamp' => $copyPos ), __METHOD__ ); |
@@ -45,6 +45,9 @@ |
||
| 45 | 45 | print $this->getFormattedResults(); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | + /** |
|
| 49 | + * @param string $proto |
|
| 50 | + */ |
|
| 48 | 51 | static function doRequest( $proto ) { |
| 49 | 52 | Http::get( "$proto://localhost/", array(), __METHOD__ ); |
| 50 | 53 | } |
@@ -25,10 +25,16 @@ |
||
| 25 | 25 | |
| 26 | 26 | require_once __DIR__ . '/Benchmarker.php'; |
| 27 | 27 | |
| 28 | +/** |
|
| 29 | + * @param string $str |
|
| 30 | + */ |
|
| 28 | 31 | function bfNormalizeTitleStrTr( $str ) { |
| 29 | 32 | return strtr( $str, '_', ' ' ); |
| 30 | 33 | } |
| 31 | 34 | |
| 35 | +/** |
|
| 36 | + * @param string $str |
|
| 37 | + */ |
|
| 32 | 38 | function bfNormalizeTitleStrReplace( $str ) { |
| 33 | 39 | return str_replace( '_', ' ', $str ); |
| 34 | 40 | } |
@@ -363,6 +363,12 @@ discard block |
||
| 363 | 363 | $this->checkRegex( $file, $text, '/^[\xFF\xFE\xEF]/', 'byte-order mark' ); |
| 364 | 364 | } |
| 365 | 365 | |
| 366 | + /** |
|
| 367 | + * @param string $file |
|
| 368 | + * @param string $text |
|
| 369 | + * @param string $regex |
|
| 370 | + * @param string $desc |
|
| 371 | + */ |
|
| 366 | 372 | private function checkRegex( $file, $text, $regex, $desc ) { |
| 367 | 373 | if ( !preg_match( $regex, $text ) ) { |
| 368 | 374 | return; |
@@ -375,6 +381,11 @@ discard block |
||
| 375 | 381 | $this->output( "Warning in file $file: $desc found.\n" ); |
| 376 | 382 | } |
| 377 | 383 | |
| 384 | + /** |
|
| 385 | + * @param string $file |
|
| 386 | + * @param string $evilToken |
|
| 387 | + * @param string $desc |
|
| 388 | + */ |
|
| 378 | 389 | private function checkEvilToken( $file, $tokens, $evilToken, $desc ) { |
| 379 | 390 | if ( !in_array( $evilToken, $tokens ) ) { |
| 380 | 391 | return; |
@@ -112,6 +112,9 @@ |
||
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | + /** |
|
| 116 | + * @return string |
|
| 117 | + */ |
|
| 115 | 118 | function stripParameters( $text ) { |
| 116 | 119 | if ( !$this->stripParametersEnabled ) { |
| 117 | 120 | return $text; |
@@ -185,6 +185,9 @@ discard block |
||
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | + /** |
|
| 189 | + * @param string $dir |
|
| 190 | + */ |
|
| 188 | 191 | private function stripPath( $val, $dir ) { |
| 189 | 192 | if ( $val === $dir ) { |
| 190 | 193 | $val = ''; |
@@ -266,6 +269,9 @@ discard block |
||
| 266 | 269 | } |
| 267 | 270 | } |
| 268 | 271 | |
| 272 | + /** |
|
| 273 | + * @param string $path |
|
| 274 | + */ |
|
| 269 | 275 | protected function needsComposerAutoloader( $path ) { |
| 270 | 276 | $path .= '/composer.json'; |
| 271 | 277 | if ( file_exists( $path ) ) { |