From 912975bfe1a31de65eb09afda86c2f760e28f040 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 1 Dec 2015 13:54:34 -0800 Subject: [PATCH] Fix some IDEA errors in BacklinkJobUtils Change-Id: I0e61f93bc19c183442933dbb8192264838c1c9a1 --- includes/jobqueue/utils/BacklinkJobUtils.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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() ); -- 2.20.1