Remove unused local variables

Various variables are left from ealier refactor are now unused
and can be removed to make the code easier to read

Change-Id: Id51770af1f08e85c7e7a02234a2cd2ab5b47ee7a
This commit is contained in:
Umherirrender 2022-09-19 21:56:25 +02:00
parent 1a808ae744
commit b15e689d49
14 changed files with 1 additions and 26 deletions

View file

@ -929,7 +929,6 @@ abstract class ParsoidHandler extends Handler {
* @throws HttpException
*/
protected function pb2pb( array $attribs ) {
$request = $this->getRequest();
$opts = $attribs['opts'];
$revision = $opts['previous'] ?? $opts['original'] ?? null;

View file

@ -1174,8 +1174,6 @@ return [
},
'PageEditStash' => static function ( MediaWikiServices $services ): PageEditStash {
$config = $services->getMainConfig();
return new PageEditStash(
ObjectCache::getLocalClusterInstance(),
$services->getDBLoadBalancer(),

View file

@ -566,7 +566,7 @@ class XmlDumpWriter {
}
$data = $contentHandler->exportTransform( $data, $contentFormat );
$textAttributes['bytes'] = $size = strlen( $data ); // make sure to use the actual size
$textAttributes['bytes'] = strlen( $data ); // make sure to use the actual size
$textAttributes['xml:space'] = 'preserve';
$out .= $indent . Xml::elementClean( 'text', $textAttributes, strval( $data ) ) . "\n";

View file

@ -251,7 +251,6 @@ abstract class HTMLFormField {
* @throws MWException
*/
protected function checkStateRecurse( array $alldata, array $params ) {
$origParams = $params;
$op = array_shift( $params );
$valueChk = [ 'AND' => false, 'OR' => true, 'NAND' => false, 'NOR' => true ];
$valueRet = [ 'AND' => true, 'OR' => false, 'NAND' => false, 'NOR' => true ];
@ -293,7 +292,6 @@ abstract class HTMLFormField {
* @return mixed[]
*/
protected function parseCondState( $params ) {
$origParams = $params;
$op = array_shift( $params );
switch ( $op ) {

View file

@ -266,7 +266,6 @@ class WebInstallerOptions extends WebInstallerPage {
'class' => 'config-ext-input'
];
$labelAttribs = [];
$fullDepList = [];
if ( isset( $info['requires']['extensions'] ) ) {
$dependencyMap[$ext]['extensions'] = $info['requires']['extensions'];
$labelAttribs['class'] = 'mw-ext-with-dependencies';

View file

@ -402,7 +402,6 @@ class StatusValue {
);
if ( count( $this->errors ) > 0 ) {
$hdr = sprintf( "+-%'-8s-+-%'-25s-+-%'-36s-+\n", "", "", "" );
$i = 1;
$out .= "\n";
$out .= $hdr;
foreach ( $this->errors as $error ) {
@ -431,8 +430,6 @@ class StatusValue {
$paramsChunk
);
}
$i++;
}
$out .= $hdr;
}

View file

@ -87,7 +87,6 @@ class FileOpBatch {
// Update list of affected paths in this batch
$curBatchDeps = $fileOp->applyDependencies( $curBatchDeps );
// Simulate performing the operation...
$oldPredicates = $predicates;
$subStatus = $fileOp->precheck( $predicates ); // updates $predicates
$status->merge( $subStatus );
if ( !$subStatus->isOK() ) {

View file

@ -1650,7 +1650,6 @@ class LoadBalancer implements ILoadBalancerForOwner {
/** @noinspection PhpUnusedLocalVariableInspection */
$scope = ScopedCallback::newScopedIgnoreUserAbort();
foreach ( $this->getOpenConnections() as $conn ) {
$srvName = $conn->getServerName();
$conn->close( $fname );
}

View file

@ -854,7 +854,6 @@ class Article implements Page {
protected function showDiffPage() {
$context = $this->getContext();
$request = $context->getRequest();
$user = $context->getUser();
$diff = $request->getVal( 'diff' );
$rcid = $request->getInt( 'rcid' );
$purge = $request->getRawVal( 'action' ) === 'purge';

View file

@ -540,15 +540,12 @@ class SearchHighlighter {
$max = intval( $contextchars ) + 1;
$pat1 = "/(.*)($terms)(.{0,$max})/i";
$lineno = 0;
$extract = "";
$contLang = MediaWikiServices::getInstance()->getContentLanguage();
foreach ( $lines as $line ) {
if ( $contextlines == 0 ) {
break;
}
++$lineno;
$m = [];
if ( !preg_match( $pat1, $line, $m ) ) {
continue;

View file

@ -1250,8 +1250,6 @@ class SkinTemplate extends Skin {
$talkId = "{$subjectId}_talk";
}
$skname = $this->skinname;
// Adds namespace links
if ( $subjectId === 'user' ) {
$subjectMsg = wfMessage( 'nstab-user', $subjectPage->getRootText() );

View file

@ -354,7 +354,6 @@ class SpecialUpload extends SpecialPage {
*/
protected function showViewDeletedLinks() {
$title = Title::makeTitleSafe( NS_FILE, $this->mDesiredDestName );
$user = $this->getUser();
// Show a subtitle link to deleted revisions (to sysops et al only)
if ( $title instanceof Title ) {
$count = $title->getDeletedEditsCount();

View file

@ -715,9 +715,6 @@ class SpecialVersion extends SpecialPage {
* @return string
*/
protected function getExtensionCategory( $type, ?string $text, array $creditsGroup ) {
$config = $this->getConfig();
$credits = $config->get( MainConfigNames::ExtensionCredits );
$out = '';
if ( $creditsGroup ) {

View file

@ -249,10 +249,6 @@ class TrackBlobs {
],
[ 'blob_tracking' => [ 'LEFT JOIN', 'bt_text_id=old_id' ] ]
);
$ids = [];
foreach ( $res as $row ) {
$ids[] = $row->old_id;
}
if ( !$res->numRows() ) {
break;