@@ -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 ) ) { |
@@ -70,6 +70,9 @@ |
||
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | + /** |
|
| 74 | + * @param Iterator $jobs |
|
| 75 | + */ |
|
| 73 | 76 | protected function copyJobs( JobQueue $src, JobQueue $dst, $jobs ) { |
| 74 | 77 | $total = 0; |
| 75 | 78 | $totalOK = 0; |
@@ -230,6 +230,9 @@ discard block |
||
| 230 | 230 | $this->timeOfCheckpoint = $this->startTime; |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | + /** |
|
| 234 | + * @param boolean $history |
|
| 235 | + */ |
|
| 233 | 236 | function dump( $history, $text = WikiExporter::TEXT ) { |
| 234 | 237 | // Notice messages will foul up your XML output even if they're |
| 235 | 238 | // relatively harmless. |
@@ -521,7 +524,7 @@ discard block |
||
| 521 | 524 | * is thrown. |
| 522 | 525 | * |
| 523 | 526 | * @param string $id The revision id to get the text for |
| 524 | - * @param string|bool|null $model The content model used to determine |
|
| 527 | + * @param string $model The content model used to determine |
|
| 525 | 528 | * applicable export transformations. |
| 526 | 529 | * If $model is null, it will be determined from the database. |
| 527 | 530 | * @param string|null $format The content format used when applying export transformations. |
@@ -716,6 +719,11 @@ discard block |
||
| 716 | 719 | return $normalized; |
| 717 | 720 | } |
| 718 | 721 | |
| 722 | + /** |
|
| 723 | + * @param string $id |
|
| 724 | + * |
|
| 725 | + * @return string|null |
|
| 726 | + */ |
|
| 719 | 727 | private function getTextSpawned( $id ) { |
| 720 | 728 | MediaWiki\suppressWarnings(); |
| 721 | 729 | if ( !$this->spawnProc ) { |
@@ -948,6 +956,9 @@ discard block |
||
| 948 | 956 | } |
| 949 | 957 | } |
| 950 | 958 | |
| 959 | + /** |
|
| 960 | + * @param string $data |
|
| 961 | + */ |
|
| 951 | 962 | function characterData( $parser, $data ) { |
| 952 | 963 | $this->clearOpenElement( null ); |
| 953 | 964 | if ( $this->lastName == "id" ) { |
@@ -973,6 +984,9 @@ discard block |
||
| 973 | 984 | $this->buffer .= htmlspecialchars( $data ); |
| 974 | 985 | } |
| 975 | 986 | |
| 987 | + /** |
|
| 988 | + * @param null|string $style |
|
| 989 | + */ |
|
| 976 | 990 | function clearOpenElement( $style ) { |
| 977 | 991 | if ( $this->openElement ) { |
| 978 | 992 | $this->buffer .= Xml::element( $this->openElement[0], $this->openElement[1], $style ); |
@@ -108,6 +108,9 @@ |
||
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | + /** |
|
| 112 | + * @param boolean $shared |
|
| 113 | + */ |
|
| 111 | 114 | function outputItem( $name, $shared ) { |
| 112 | 115 | $file = wfFindFile( $name ); |
| 113 | 116 | if ( $file && $this->filterItem( $file, $shared ) ) { |
@@ -37,6 +37,9 @@ |
||
| 37 | 37 | return $retVal; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | + /** |
|
| 41 | + * @param string $filename |
|
| 42 | + */ |
|
| 40 | 43 | public function setCurrentFile( $filename ) { |
| 41 | 44 | $this->currentFile = $filename; |
| 42 | 45 | } |
@@ -70,6 +70,9 @@ |
||
| 70 | 70 | $this->checkFiles( $repo, $pathBatch, $verbose ); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | + /** |
|
| 74 | + * @param boolean $verbose |
|
| 75 | + */ |
|
| 73 | 76 | protected function checkFiles( LocalRepo $repo, array $paths, $verbose ) { |
| 74 | 77 | if ( !count( $paths ) ) { |
| 75 | 78 | return; |