From: Aaron Schulz Date: Tue, 1 Dec 2015 21:54:34 +0000 (-0800) Subject: Fix some IDEA errors in BacklinkJobUtils X-Git-Tag: 1.31.0-rc.0~8813^2 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=912975bfe1a31de65eb09afda86c2f760e28f040;p=lhc%2Fweb%2Fwiklou.git Fix some IDEA errors in BacklinkJobUtils Change-Id: I0e61f93bc19c183442933dbb8192264838c1c9a1 --- diff --git a/includes/jobqueue/utils/BacklinkJobUtils.php b/includes/jobqueue/utils/BacklinkJobUtils.php index c8e5df66f7..1586f89bd8 100644 --- a/includes/jobqueue/utils/BacklinkJobUtils.php +++ b/includes/jobqueue/utils/BacklinkJobUtils.php @@ -71,6 +71,7 @@ class BacklinkJobUtils { if ( isset( $params['pages'] ) || empty( $params['recursive'] ) ) { $ranges = array(); // sanity; this is a leaf node + $realBSize = 0; wfWarn( __METHOD__ . " called on {$job->getType()} leaf job (explosive recursion)." ); } elseif ( isset( $params['range'] ) ) { // This is a range job to trigger the insertion of partitioned/title jobs... @@ -88,8 +89,10 @@ class BacklinkJobUtils { // Combine the first range (of size $bSize) backlinks into leaf jobs if ( isset( $ranges[0] ) ) { list( $start, $end ) = $ranges[0]; - $titles = $title->getBacklinkCache()->getLinks( $params['table'], $start, $end ); - foreach ( array_chunk( iterator_to_array( $titles ), $cSize ) as $titleBatch ) { + $iter = $title->getBacklinkCache()->getLinks( $params['table'], $start, $end ); + $titles = iterator_to_array( $iter ); + /** @var Title[] $titleBatch */ + foreach ( array_chunk( $titles, $cSize ) as $titleBatch ) { $pages = array(); foreach ( $titleBatch as $tl ) { $pages[$tl->getArticleId()] = array( $tl->getNamespace(), $tl->getDBKey() );