diff options
Diffstat (limited to 'includes')
21 files changed, 77 insertions, 128 deletions
diff --git a/includes/ResourceLoader/ResourceLoader.php b/includes/ResourceLoader/ResourceLoader.php index 442b9d8d58c9..f7d815df01e2 100644 --- a/includes/ResourceLoader/ResourceLoader.php +++ b/includes/ResourceLoader/ResourceLoader.php @@ -1125,7 +1125,6 @@ MESSAGE; } elseif ( is_array( $scripts ) ) { // ...except when $scripts is an array of URLs or an associative array $strContent = self::makeLoaderImplementScript( - $context, $implementKey, $scripts, [], @@ -1157,7 +1156,6 @@ MESSAGE; } } $strContent = self::makeLoaderImplementScript( - $context, $implementKey, $scripts, $content['styles'] ?? [], @@ -1258,7 +1256,6 @@ MESSAGE; /** * Return JS code that calls mw.loader.implement with given module properties. * - * @param Context $context * @param string $name Module name or implement key (format "`[name]@[version]`") * @param XmlJsCode|array|string $scripts Code as XmlJsCode (to be wrapped in a closure), * list of URLs to JavaScript files, string of JavaScript for eval, or array with @@ -1273,7 +1270,7 @@ MESSAGE; * @return string JavaScript code */ private static function makeLoaderImplementScript( - Context $context, $name, $scripts, $styles, $messages, $templates + $name, $scripts, $styles, $messages, $templates ) { if ( $scripts instanceof XmlJsCode ) { if ( $scripts->value === '' ) { diff --git a/includes/Revision/RevisionStore.php b/includes/Revision/RevisionStore.php index 2711df9b8a13..c0044017dbe7 100644 --- a/includes/Revision/RevisionStore.php +++ b/includes/Revision/RevisionStore.php @@ -1528,7 +1528,6 @@ class RevisionStore * public, since RevisionSlots instances should not be constructed directly. * * @param int $revId - * @param \stdClass $revisionRow * @param \stdClass[]|null $slotRows * @param int $queryFlags * @param PageIdentity $page @@ -1538,7 +1537,6 @@ class RevisionStore */ private function newRevisionSlots( $revId, - $revisionRow, $slotRows, $queryFlags, PageIdentity $page @@ -1678,7 +1676,7 @@ class RevisionStore $comment = $this->commentStore->getCommentLegacy( $db, 'ar_comment', $row, true ); if ( !( $slots instanceof RevisionSlots ) ) { - $slots = $this->newRevisionSlots( (int)$row->ar_rev_id, $row, $slots, $queryFlags, $page ); + $slots = $this->newRevisionSlots( (int)$row->ar_rev_id, $slots, $queryFlags, $page ); } return new RevisionArchiveRecord( $page, $user, $comment, $row, $slots, $this->wikiId ); } @@ -1761,7 +1759,7 @@ class RevisionStore $comment = $this->commentStore->getCommentLegacy( $db, 'rev_comment', $row, true ); if ( !( $slots instanceof RevisionSlots ) ) { - $slots = $this->newRevisionSlots( (int)$row->rev_id, $row, $slots, $queryFlags, $page ); + $slots = $this->newRevisionSlots( (int)$row->rev_id, $slots, $queryFlags, $page ); } // If this is a cached row, instantiate a cache-aware RevisionRecord to avoid stale data. diff --git a/includes/auth/AuthManager.php b/includes/auth/AuthManager.php index c158b41f8cd6..fd10a37c4377 100644 --- a/includes/auth/AuthManager.php +++ b/includes/auth/AuthManager.php @@ -1087,12 +1087,10 @@ class AuthManager implements LoggerAwareInterface { /** * @param callable $authorizer ( string $action, PageIdentity $target, PermissionStatus $status ) - * @param Authority $creator * @return StatusValue */ private function authorizeInternal( - callable $authorizer, - Authority $creator + callable $authorizer ): StatusValue { // Wiki is read-only? if ( $this->readOnlyMode->isReadOnly() ) { @@ -1135,8 +1133,7 @@ class AuthManager implements LoggerAwareInterface { PermissionStatus $status ) use ( $creator ) { return $creator->probablyCan( $action, $target, $status ); - }, - $creator + } ); } @@ -1159,8 +1156,7 @@ class AuthManager implements LoggerAwareInterface { PermissionStatus $status ) use ( $creator ) { return $creator->authorizeWrite( $action, $target, $status ); - }, - $creator + } ); } diff --git a/includes/exception/MWExceptionRenderer.php b/includes/exception/MWExceptionRenderer.php index 114a77263ff0..b7b7d1c3f67c 100644 --- a/includes/exception/MWExceptionRenderer.php +++ b/includes/exception/MWExceptionRenderer.php @@ -120,7 +120,7 @@ class MWExceptionRenderer { $message .= 'Original exception: ' . MWExceptionHandler::getPublicLogMessage( $e ); $message .= "\n\nException caught inside exception handler.\n\n" . - self::getShowBacktraceError( $e ); + self::getShowBacktraceError(); } $message .= "\n"; } elseif ( $showExceptionDetails ) { @@ -229,7 +229,7 @@ class MWExceptionRenderer { ) ), '', 'mw-content-ltr' - ) . "<!-- " . wordwrap( self::getShowBacktraceError( $e ), 50 ) . " -->"; + ) . "<!-- " . wordwrap( self::getShowBacktraceError(), 50 ) . " -->"; } return $html; @@ -270,15 +270,14 @@ class MWExceptionRenderer { "\nBacktrace:\n" . MWExceptionHandler::getRedactedTraceAsString( $e ) . "\n"; } else { - return self::getShowBacktraceError( $e ) . "\n"; + return self::getShowBacktraceError() . "\n"; } } /** - * @param Throwable $e * @return string */ - private static function getShowBacktraceError( Throwable $e ) { + private static function getShowBacktraceError() { $var = '$wgShowExceptionDetails = true;'; return "Set $var at the bottom of LocalSettings.php to show detailed debugging information."; } diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index c816861ed608..05cce4a58aa2 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -467,9 +467,8 @@ abstract class DatabaseUpdater { * @since 1.21 * * Writes the schema updates desired to a file for the DB Admin to run. - * @param array $schemaUpdate */ - private function writeSchemaUpdateFile( array $schemaUpdate = [] ) { + private function writeSchemaUpdateFile() { $updates = $this->updatesSkipped; $this->updatesSkipped = []; diff --git a/includes/libs/StatusValue.php b/includes/libs/StatusValue.php index d8b524e86e0c..317a9f05bdb1 100644 --- a/includes/libs/StatusValue.php +++ b/includes/libs/StatusValue.php @@ -237,7 +237,7 @@ class StatusValue { * @return $this */ public function warning( $message, ...$parameters ) { - $message = $this->normalizeMessage( $message, $parameters ); + $message = $this->normalizeMessage( $message ); return $this->addError( [ 'type' => 'warning', @@ -255,7 +255,7 @@ class StatusValue { * @return $this */ public function error( $message, ...$parameters ) { - $message = $this->normalizeMessage( $message, $parameters ); + $message = $this->normalizeMessage( $message ); return $this->addError( [ 'type' => 'error', @@ -525,11 +525,10 @@ class StatusValue { /** * @param MessageSpecifier|MessageValue|string $message - * @param array $parameters * * @return MessageSpecifier|string */ - private function normalizeMessage( $message, array $parameters = [] ) { + private function normalizeMessage( $message ) { if ( $message instanceof MessageValue ) { $converter = new Converter(); return $converter->convertMessageValue( $message ); diff --git a/includes/libs/mime/IEContentAnalyzer.php b/includes/libs/mime/IEContentAnalyzer.php index 3382d18bf0ce..4f8f9cd9eba1 100644 --- a/includes/libs/mime/IEContentAnalyzer.php +++ b/includes/libs/mime/IEContentAnalyzer.php @@ -415,8 +415,8 @@ class IEContentAnalyzer { $result = $this->sampleData( $version, $chunk ); $sampleFound = $result['found']; $counters = $result['counters']; - $binaryType = $this->checkBinaryHeaders( $version, $chunk ); - $textType = $this->checkTextHeaders( $version, $chunk ); + $binaryType = $this->checkBinaryHeaders( $chunk ); + $textType = $this->checkTextHeaders( $chunk ); if ( $proposed == 'text/html' && isset( $sampleFound['html'] ) ) { return 'text/html'; @@ -552,11 +552,10 @@ class IEContentAnalyzer { /** * Check for text headers at the start of the chunk * Confirmed same in 5 and 7. - * @param string $version * @param string $chunk * @return bool|string */ - private function checkTextHeaders( $version, $chunk ) { + private function checkTextHeaders( $chunk ) { $chunk2 = substr( $chunk, 0, 2 ); $chunk4 = substr( $chunk, 0, 4 ); $chunk5 = substr( $chunk, 0, 5 ); @@ -578,11 +577,10 @@ class IEContentAnalyzer { /** * Check for binary headers at the start of the chunk * Confirmed same in 5 and 7. - * @param string $version * @param string $chunk * @return bool|string */ - private function checkBinaryHeaders( $version, $chunk ) { + private function checkBinaryHeaders( $chunk ) { $chunk2 = substr( $chunk, 0, 2 ); $chunk3 = substr( $chunk, 0, 3 ); $chunk4 = substr( $chunk, 0, 4 ); diff --git a/includes/libs/mime/MimeAnalyzer.php b/includes/libs/mime/MimeAnalyzer.php index 46cec212e9bf..4d52e0f138be 100644 --- a/includes/libs/mime/MimeAnalyzer.php +++ b/includes/libs/mime/MimeAnalyzer.php @@ -520,7 +520,7 @@ class MimeAnalyzer implements LoggerAwareInterface { "Use improveTypeFromExtension(\$mime, \$ext) instead." ); } - $mime = $this->doGuessMimeType( $file, $ext ); + $mime = $this->doGuessMimeType( $file ); if ( !$mime ) { $this->logger->info( __METHOD__ . @@ -539,14 +539,11 @@ class MimeAnalyzer implements LoggerAwareInterface { /** * Guess the MIME type from the file contents. * - * @todo Remove $ext param - * * @param string $file - * @param string|bool $ext * @return bool|string * @throws UnexpectedValueException */ - private function doGuessMimeType( string $file, $ext ) { + private function doGuessMimeType( string $file ) { // Read a chunk of the file AtEase::suppressWarnings(); $f = fopen( $file, 'rb' ); diff --git a/includes/libs/objectcache/HashBagOStuff.php b/includes/libs/objectcache/HashBagOStuff.php index 46ce896c216c..7be73cc44522 100644 --- a/includes/libs/objectcache/HashBagOStuff.php +++ b/includes/libs/objectcache/HashBagOStuff.php @@ -120,14 +120,14 @@ class HashBagOStuff extends MediumSpecificBagOStuff { } public function incr( $key, $value = 1, $flags = 0 ) { - return $this->doIncr( $key, $value, $flags ); + return $this->doIncr( $key, $value ); } public function decr( $key, $value = 1, $flags = 0 ) { - return $this->doIncr( $key, -$value, $flags ); + return $this->doIncr( $key, -$value ); } - private function doIncr( $key, $value = 1, $flags = 0 ) { + private function doIncr( $key, $value = 1 ) { $n = $this->doGet( $key ); if ( $this->isInteger( $n ) ) { $n = max( $n + (int)$value, 0 ); diff --git a/includes/libs/objectcache/RESTBagOStuff.php b/includes/libs/objectcache/RESTBagOStuff.php index c42e60171e3e..35556371d51b 100644 --- a/includes/libs/objectcache/RESTBagOStuff.php +++ b/includes/libs/objectcache/RESTBagOStuff.php @@ -253,14 +253,14 @@ class RESTBagOStuff extends MediumSpecificBagOStuff { } public function incr( $key, $value = 1, $flags = 0 ) { - return $this->doIncr( $key, $value, $flags ); + return $this->doIncr( $key, $value ); } public function decr( $key, $value = 1, $flags = 0 ) { - return $this->doIncr( $key, -$value, $flags ); + return $this->doIncr( $key, -$value ); } - private function doIncr( $key, $value = 1, $flags = 0 ) { + private function doIncr( $key, $value = 1 ) { // NOTE: This is non-atomic $n = $this->get( $key, self::READ_LATEST ); // key exists? diff --git a/includes/libs/objectcache/WinCacheBagOStuff.php b/includes/libs/objectcache/WinCacheBagOStuff.php index 2c692d2027de..908538bfab03 100644 --- a/includes/libs/objectcache/WinCacheBagOStuff.php +++ b/includes/libs/objectcache/WinCacheBagOStuff.php @@ -165,14 +165,14 @@ class WinCacheBagOStuff extends MediumSpecificBagOStuff { } public function incr( $key, $value = 1, $flags = 0 ) { - return $this->doIncr( $key, $value, $flags ); + return $this->doIncr( $key, $value ); } public function decr( $key, $value = 1, $flags = 0 ) { - return $this->doIncr( $key, -$value, $flags ); + return $this->doIncr( $key, -$value ); } - private function doIncr( $key, $value = 1, $flags = 0 ) { + private function doIncr( $key, $value = 1 ) { // optimize with FIFO lock if ( !wincache_lock( $key ) ) { return false; diff --git a/includes/linker/LinkRenderer.php b/includes/linker/LinkRenderer.php index fbbd5dd83c98..761878013337 100644 --- a/includes/linker/LinkRenderer.php +++ b/includes/linker/LinkRenderer.php @@ -161,7 +161,7 @@ class LinkRenderer { } } - private function runBeginHook( $target, &$text, &$extraAttribs, &$query, $isKnown ) { + private function runBeginHook( $target, &$text, &$extraAttribs, &$query ) { $ret = null; if ( !$this->hookRunner->onHtmlPageLinkRendererBegin( // @phan-suppress-next-line PhanTypeMismatchArgument Type mismatch on pass-by-ref args @@ -188,7 +188,7 @@ class LinkRenderer { Assert::parameterType( [ LinkTarget::class, PageReference::class ], $target, '$target' ); // Run begin hook - $ret = $this->runBeginHook( $target, $text, $extraAttribs, $query, true ); + $ret = $this->runBeginHook( $target, $text, $extraAttribs, $query ); if ( $ret !== null ) { return $ret; } @@ -258,7 +258,7 @@ class LinkRenderer { ) { Assert::parameterType( [ LinkTarget::class, PageReference::class ], $target, '$target' ); // Run legacy hook - $ret = $this->runBeginHook( $target, $text, $extraAttribs, $query, false ); + $ret = $this->runBeginHook( $target, $text, $extraAttribs, $query ); if ( $ret !== null ) { return $ret; } diff --git a/includes/media/ImageHandler.php b/includes/media/ImageHandler.php index 8a8af050fa22..12fa710a7388 100644 --- a/includes/media/ImageHandler.php +++ b/includes/media/ImageHandler.php @@ -106,8 +106,6 @@ abstract class ImageHandler extends MediaHandler { * @phan-assert array{width:int,physicalWidth:int,height:int,physicalHeight:int,page:int} $params */ public function normaliseParams( $image, &$params ) { - $mimeType = $image->getMimeType(); - if ( !isset( $params['width'] ) ) { return false; } @@ -164,7 +162,7 @@ abstract class ImageHandler extends MediaHandler { } if ( !$this->validateThumbParams( $params['physicalWidth'], - $params['physicalHeight'], $srcWidth, $srcHeight, $mimeType ) + $params['physicalHeight'], $srcWidth, $srcHeight ) ) { return false; } @@ -179,10 +177,9 @@ abstract class ImageHandler extends MediaHandler { * @param int &$height Height (output only) * @param int $srcWidth Width of the source image * @param int $srcHeight Height of the source image - * @param string $mimeType Unused * @return bool False to indicate that an error should be returned to the user. */ - private function validateThumbParams( &$width, &$height, $srcWidth, $srcHeight, $mimeType ) { + private function validateThumbParams( &$width, &$height, $srcWidth, $srcHeight ) { $width = intval( $width ); if ( $width <= 0 ) { diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php index dbfc4c3f19a3..9260b2115e1d 100644 --- a/includes/objectcache/SqlBagOStuff.php +++ b/includes/objectcache/SqlBagOStuff.php @@ -209,8 +209,7 @@ class SqlBagOStuff extends MediumSpecificBagOStuff { return $this->modifyBlobs( [ $this, 'modifyTableSpecificBlobsForSet' ], $mtime, - [ $key => [ $value, $exptime ] ], - $flags + [ $key => [ $value, $exptime ] ] ); } @@ -220,8 +219,7 @@ class SqlBagOStuff extends MediumSpecificBagOStuff { return $this->modifyBlobs( [ $this, 'modifyTableSpecificBlobsForDelete' ], $mtime, - [ $key => [] ], - $flags + [ $key => [] ] ); } @@ -235,8 +233,7 @@ class SqlBagOStuff extends MediumSpecificBagOStuff { return $this->modifyBlobs( [ $this, 'modifyTableSpecificBlobsForAdd' ], $mtime, - [ $key => [ $value, $exptime ] ], - $flags + [ $key => [ $value, $exptime ] ] ); } @@ -250,8 +247,7 @@ class SqlBagOStuff extends MediumSpecificBagOStuff { return $this->modifyBlobs( [ $this, 'modifyTableSpecificBlobsForCas' ], $mtime, - [ $key => [ $value, $exptime, $casToken ] ], - $flags + [ $key => [ $value, $exptime, $casToken ] ] ); } @@ -261,8 +257,7 @@ class SqlBagOStuff extends MediumSpecificBagOStuff { return $this->modifyBlobs( [ $this, 'modifyTableSpecificBlobsForChangeTTL' ], $mtime, - [ $key => [ $exptime ] ], - $flags + [ $key => [ $exptime ] ] ); } @@ -279,7 +274,6 @@ class SqlBagOStuff extends MediumSpecificBagOStuff { $callback, $mtime, [ $key => [ $step, $init, $exptime ] ], - $flags, $resByKey ) ? $resByKey[$key] : false; @@ -310,8 +304,7 @@ class SqlBagOStuff extends MediumSpecificBagOStuff { [ $this, 'modifyTableSpecificBlobsForSet' ], $mtime, // Preserve the old expiry timestamp - [ $key => [ $newValue, $data[self::BLOB_EXPIRY] ] ], - $flags + [ $key => [ $newValue, $data[self::BLOB_EXPIRY] ] ] ) ? $newValue : false; } else { $result = false; @@ -363,8 +356,7 @@ class SqlBagOStuff extends MediumSpecificBagOStuff { return [ $value, $exptime ]; }, $data - ), - $flags + ) ); } @@ -374,8 +366,7 @@ class SqlBagOStuff extends MediumSpecificBagOStuff { return $this->modifyBlobs( [ $this, 'modifyTableSpecificBlobsForDelete' ], $mtime, - array_fill_keys( $keys, [] ), - $flags + array_fill_keys( $keys, [] ) ); } @@ -385,8 +376,7 @@ class SqlBagOStuff extends MediumSpecificBagOStuff { return $this->modifyBlobs( [ $this, 'modifyTableSpecificBlobsForChangeTTL' ], $mtime, - array_fill_keys( $keys, [ $exptime ] ), - $flags + array_fill_keys( $keys, [ $exptime ] ) ); } @@ -542,7 +532,6 @@ class SqlBagOStuff extends MediumSpecificBagOStuff { * - Map of (key => result) [returned] * @param float $mtime UNIX modification timestamp * @param array<string,array> $argsByKey Map of (key => list of arguments) - * @param int $flags Bitfield of BagOStuff::WRITE_* constants * @param array<string,mixed> &$resByKey Order-preserved map of (key => result) [returned] * @return bool Whether all keys were processed * @param-taint $argsByKey none @@ -551,7 +540,6 @@ class SqlBagOStuff extends MediumSpecificBagOStuff { callable $tableWriteCallback, float $mtime, array $argsByKey, - int $flags, &$resByKey = [] ) { // Initialize order-preserved per-key results; callbacks mark successful results diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index f23294418006..360c833a39fa 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -1394,7 +1394,6 @@ class CoreParserFunctions { Title $title, int $start, int $len, - bool $isNoArgForm, int $mtts ): string { // Note that {{REVISIONTIMESTAMP}} works differently from @@ -1447,7 +1446,7 @@ class CoreParserFunctions { return ''; } return strval( (int)self::getRevisionTimestampSubstring( - $parser, $t, 6, 2, ( $title === null ), self::MAX_TTS + $parser, $t, 6, 2, self::MAX_TTS ) ); } @@ -1464,7 +1463,7 @@ class CoreParserFunctions { return ''; } return self::getRevisionTimestampSubstring( - $parser, $t, 6, 2, ( $title === null ), self::MAX_TTS + $parser, $t, 6, 2, self::MAX_TTS ); } @@ -1481,7 +1480,7 @@ class CoreParserFunctions { return ''; } return self::getRevisionTimestampSubstring( - $parser, $t, 4, 2, ( $title === null ), self::MAX_TTS + $parser, $t, 4, 2, self::MAX_TTS ); } @@ -1498,7 +1497,7 @@ class CoreParserFunctions { return ''; } return strval( (int)self::getRevisionTimestampSubstring( - $parser, $t, 4, 2, ( $title === null ), self::MAX_TTS + $parser, $t, 4, 2, self::MAX_TTS ) ); } @@ -1515,7 +1514,7 @@ class CoreParserFunctions { return ''; } return self::getRevisionTimestampSubstring( - $parser, $t, 0, 4, ( $title === null ), self::MAX_TTS + $parser, $t, 0, 4, self::MAX_TTS ); } @@ -1532,7 +1531,7 @@ class CoreParserFunctions { return ''; } return self::getRevisionTimestampSubstring( - $parser, $t, 0, 14, ( $title === null ), self::MAX_TTS + $parser, $t, 0, 14, self::MAX_TTS ); } diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 9316ee01e6c0..428b8ac20825 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -4995,11 +4995,10 @@ class Parser { * Placeholders created in Linker::link() * * @param string &$text - * @param int $options * @deprecated since 1.34; should not be used outside parser class. */ - public function replaceLinkHolders( &$text, $options = 0 ) { - $this->replaceLinkHoldersPrivate( $text, $options ); + public function replaceLinkHolders( &$text ) { + $this->replaceLinkHoldersPrivate( $text ); } /** @@ -5007,9 +5006,8 @@ class Parser { * Placeholders created in Linker::link() * * @param string &$text - * @param int $options */ - private function replaceLinkHoldersPrivate( &$text, $options = 0 ) { + private function replaceLinkHoldersPrivate( &$text ) { $this->mLinkHolders->replace( $text ); } diff --git a/includes/parser/RevisionOutputCache.php b/includes/parser/RevisionOutputCache.php index 53ad9d2afa2a..f01f2a6b05aa 100644 --- a/includes/parser/RevisionOutputCache.php +++ b/includes/parser/RevisionOutputCache.php @@ -100,10 +100,9 @@ class RevisionOutputCache { } /** - * @param RevisionRecord $revision * @param string $metricSuffix */ - private function incrementStats( RevisionRecord $revision, string $metricSuffix ) { + private function incrementStats( string $metricSuffix ) { $metricSuffix = str_replace( '.', '_', $metricSuffix ); $this->stats->increment( "RevisionOutputCache.{$this->name}.{$metricSuffix}" ); } @@ -188,7 +187,7 @@ class RevisionOutputCache { } if ( !$parserOptions->isSafeToCache() ) { - $this->incrementStats( $revision, 'miss.unsafe' ); + $this->incrementStats( 'miss.unsafe' ); return false; } @@ -196,13 +195,13 @@ class RevisionOutputCache { $json = $this->cache->get( $cacheKey ); if ( $json === false ) { - $this->incrementStats( $revision, 'miss.absent' ); + $this->incrementStats( 'miss.absent' ); return false; } $output = $this->restoreFromJson( $json, $cacheKey, ParserOutput::class ); if ( $output === null ) { - $this->incrementStats( $revision, 'miss.unserialize' ); + $this->incrementStats( 'miss.unserialize' ); return false; } @@ -211,12 +210,12 @@ class RevisionOutputCache { $expiryTime = max( $expiryTime, (int)MWTimestamp::now( TS_UNIX ) - $this->cacheExpiry ); if ( $cacheTime < $expiryTime ) { - $this->incrementStats( $revision, 'miss.expired' ); + $this->incrementStats( 'miss.expired' ); return false; } $this->logger->debug( 'old-revision cache hit' ); - $this->incrementStats( $revision, 'hit' ); + $this->incrementStats( 'hit' ); return $output; } @@ -260,23 +259,23 @@ class RevisionOutputCache { $expiry = $output->getCacheExpiry(); if ( $expiry <= 0 ) { - $this->incrementStats( $revision, 'save.uncacheable' ); + $this->incrementStats( 'save.uncacheable' ); return; } if ( !$parserOptions->isSafeToCache() ) { - $this->incrementStats( $revision, 'save.unsafe' ); + $this->incrementStats( 'save.unsafe' ); return; } $json = $this->encodeAsJson( $output, $cacheKey ); if ( $json === null ) { - $this->incrementStats( $revision, 'save.nonserializable' ); + $this->incrementStats( 'save.nonserializable' ); return; } $this->cache->set( $cacheKey, $json, $expiry ); - $this->incrementStats( $revision, 'save.success' ); + $this->incrementStats( 'save.success' ); } /** diff --git a/includes/registration/VersionChecker.php b/includes/registration/VersionChecker.php index 3966e414c2eb..640925bd8f42 100644 --- a/includes/registration/VersionChecker.php +++ b/includes/registration/VersionChecker.php @@ -159,8 +159,7 @@ class VersionChecker { case ExtensionRegistry::MEDIAWIKI_CORE: $mwError = $this->handleDependency( $this->coreVersion, - $values, - $extension + $values ); if ( $mwError !== false ) { $errors[] = [ @@ -179,8 +178,7 @@ class VersionChecker { // PHP version $phpError = $this->handleDependency( $this->phpVersion, - $constraint, - $extension + $constraint ); if ( $phpError !== false ) { $errors[] = [ @@ -274,10 +272,9 @@ class VersionChecker { * * @param Constraint|false $version The version installed * @param string $constraint The required version constraint for this dependency - * @param string $checkedExt The Extension, which depends on this dependency * @return bool false if no error, true else */ - private function handleDependency( $version, $constraint, $checkedExt ) { + private function handleDependency( $version, $constraint ) { if ( $version === false ) { // Couldn't parse the version, so we can't check anything return false; diff --git a/includes/search/SearchPostgres.php b/includes/search/SearchPostgres.php index 2266fa73743f..80c0bedc60d2 100644 --- a/includes/search/SearchPostgres.php +++ b/includes/search/SearchPostgres.php @@ -41,7 +41,7 @@ class SearchPostgres extends SearchDatabase { * @return SqlSearchResultSet */ protected function doSearchTitleInDB( $term ) { - $q = $this->searchQuery( $term, 'titlevector', 'page_title' ); + $q = $this->searchQuery( $term, 'titlevector' ); $olderror = error_reporting( E_ERROR ); $dbr = $this->lb->getConnectionRef( DB_REPLICA ); $resultSet = $dbr->query( $q, 'SearchPostgres', IDatabase::QUERY_SILENCE_ERRORS ); @@ -50,7 +50,7 @@ class SearchPostgres extends SearchDatabase { } protected function doSearchTextInDB( $term ) { - $q = $this->searchQuery( $term, 'textvector', 'old_text' ); + $q = $this->searchQuery( $term, 'textvector' ); $olderror = error_reporting( E_ERROR ); $dbr = $this->lb->getConnectionRef( DB_REPLICA ); $resultSet = $dbr->query( $q, 'SearchPostgres', IDatabase::QUERY_SILENCE_ERRORS ); @@ -126,10 +126,9 @@ class SearchPostgres extends SearchDatabase { * Construct the full SQL query to do the search. * @param string $term * @param string $fulltext - * @param string $colname * @return string */ - private function searchQuery( $term, $fulltext, $colname ) { + private function searchQuery( $term, $fulltext ) { # Get the SQL fragment for the given term $searchstring = $this->parseQuery( $term ); diff --git a/includes/specials/SpecialProtectedtitles.php b/includes/specials/SpecialProtectedtitles.php index f10869b16b73..5044c2d59074 100644 --- a/includes/specials/SpecialProtectedtitles.php +++ b/includes/specials/SpecialProtectedtitles.php @@ -78,7 +78,7 @@ class SpecialProtectedtitles extends SpecialPage { $size ); - $this->getOutput()->addHTML( $this->showOptions( $NS, $type, $level ) ); + $this->getOutput()->addHTML( $this->showOptions() ); if ( $pager->getNumRows() ) { $this->getOutput()->addHTML( @@ -137,13 +137,9 @@ class SpecialProtectedtitles extends SpecialPage { } /** - * @param int $namespace - * @param string $type - * @param string $level * @return string - * @internal */ - private function showOptions( $namespace, $type, $level ) { + private function showOptions() { $formDescriptor = [ 'namespace' => [ 'class' => HTMLSelectNamespace::class, @@ -153,7 +149,7 @@ class SpecialProtectedtitles extends SpecialPage { 'all' => '', 'label' => $this->msg( 'namespace' )->text() ], - 'levelmenu' => $this->getLevelMenu( $level ) + 'levelmenu' => $this->getLevelMenu() ]; $htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() ) @@ -165,11 +161,9 @@ class SpecialProtectedtitles extends SpecialPage { } /** - * @param string $pr_level Determines which option is selected as default * @return string|array - * @internal */ - private function getLevelMenu( $pr_level ) { + private function getLevelMenu() { // Temporary array $m = [ $this->msg( 'restriction-level-all' )->text() => 0 ]; $options = []; diff --git a/includes/specials/SpecialUploadStash.php b/includes/specials/SpecialUploadStash.php index c79674362c83..625761da5948 100644 --- a/includes/specials/SpecialUploadStash.php +++ b/includes/specials/SpecialUploadStash.php @@ -184,7 +184,6 @@ class SpecialUploadStash extends UnlistedSpecialPage { * @param array $params */ private function outputThumbFromStash( $file, $params ) { - $flags = 0; // this config option, if it exists, points to a "scaler", as you might find in // the Wikimedia Foundation cluster. See outputRemoteScaledThumb(). This // is part of our horrible NFS-based system, we create a file on a mount @@ -193,9 +192,9 @@ class SpecialUploadStash extends UnlistedSpecialPage { if ( $file->getRepo()->getThumbProxyUrl() || $this->getConfig()->get( MainConfigNames::UploadStashScalerBaseUrl ) ) { - $this->outputRemoteScaledThumb( $file, $params, $flags ); + $this->outputRemoteScaledThumb( $file, $params ); } else { - $this->outputLocallyScaledThumb( $file, $params, $flags ); + $this->outputLocallyScaledThumb( $file, $params ); } } @@ -204,16 +203,13 @@ class SpecialUploadStash extends UnlistedSpecialPage { * and output it to STDOUT. * @param File $file * @param array $params Scaling parameters ( e.g. [ width => '50' ] ); - * @param int $flags Scaling flags ( see File:: constants ) * @throws MWException|UploadStashFileNotFoundException */ - private function outputLocallyScaledThumb( $file, $params, $flags ) { + private function outputLocallyScaledThumb( $file, $params ) { // n.b. this is stupid, we insist on re-transforming the file every time we are invoked. We rely // on HTTP caching to ensure this doesn't happen. - $flags |= File::RENDER_NOW; - - $thumbnailImage = $file->transform( $params, $flags ); + $thumbnailImage = $file->transform( $params, File::RENDER_NOW ); if ( !$thumbnailImage ) { throw new UploadStashFileNotFoundException( $this->msg( 'uploadstash-file-not-found-no-thumb' ) @@ -250,10 +246,9 @@ class SpecialUploadStash extends UnlistedSpecialPage { * * @param File $file * @param array $params Scaling parameters ( e.g. [ width => '50' ] ); - * @param int $flags Scaling flags ( see File:: constants ) * @throws MWException */ - private function outputRemoteScaledThumb( $file, $params, $flags ) { + private function outputRemoteScaledThumb( $file, $params ) { // We need to use generateThumbName() instead of thumbName(), because // the suffix needs to match the file name for the remote thumbnailer // to work |