UserLocator::locateUsersWatchingTitle: Avoid confusing re-use of variable name

Change-Id: I5826fe7c4ecd15907dc63c5afd6e777637d32c8a
This commit is contained in:
Ed Sanders 2021-02-23 16:36:17 +00:00
parent 9f13424ecc
commit c5aba7e62c

View file

@ -19,27 +19,27 @@ class EchoUserLocator {
return []; return [];
} }
$it = new BatchRowIterator( $batchRowIt = new BatchRowIterator(
wfGetDB( DB_REPLICA, 'watchlist' ), wfGetDB( DB_REPLICA, 'watchlist' ),
/* $table = */ 'watchlist', /* $table = */ 'watchlist',
/* $primaryKeys = */ [ 'wl_user' ], /* $primaryKeys = */ [ 'wl_user' ],
$batchSize $batchSize
); );
$it->addConditions( [ $batchRowIt->addConditions( [
'wl_namespace' => $title->getNamespace(), 'wl_namespace' => $title->getNamespace(),
'wl_title' => $title->getDBkey(), 'wl_title' => $title->getDBkey(),
] ); ] );
$it->setCaller( __METHOD__ ); $batchRowIt->setCaller( __METHOD__ );
// flatten the result into a stream of rows // flatten the result into a stream of rows
$it = new RecursiveIteratorIterator( $it ); $recursiveIt = new RecursiveIteratorIterator( $batchRowIt );
// add callback to convert user id to user objects // add callback to convert user id to user objects
$it = new EchoCallbackIterator( $it, function ( $row ) { $echoCallbackIt = new EchoCallbackIterator( $recursiveIt, function ( $row ) {
return User::newFromId( $row->wl_user ); return User::newFromId( $row->wl_user );
} ); } );
return $it; return $echoCallbackIt;
} }
/** /**