Completed
Push — master ( 6c3a69...238e37 )
by
unknown
02:28 queued 11s
created
src/Api/CheckConstraints.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -79,19 +79,19 @@  discard block
 block discarded – undo
79 79
 	 *
80 80
 	 * @return self
81 81
 	 */
82
-	public static function newFromGlobalState( ApiMain $main, $name, $prefix = '' ) {
82
+	public static function newFromGlobalState(ApiMain $main, $name, $prefix = '') {
83 83
 		$repo = WikibaseRepo::getDefaultInstance();
84 84
 
85 85
 		$language = $repo->getUserLanguage();
86 86
 		$formatterOptions = new FormatterOptions();
87
-		$formatterOptions->setOption( SnakFormatter::OPT_LANG, $language->getCode() );
87
+		$formatterOptions->setOption(SnakFormatter::OPT_LANG, $language->getCode());
88 88
 		$valueFormatterFactory = $repo->getValueFormatterFactory();
89
-		$valueFormatter = $valueFormatterFactory->getValueFormatter( SnakFormatter::FORMAT_HTML, $formatterOptions );
89
+		$valueFormatter = $valueFormatterFactory->getValueFormatter(SnakFormatter::FORMAT_HTML, $formatterOptions);
90 90
 
91 91
 		$entityIdHtmlLinkFormatterFactory = $repo->getEntityIdHtmlLinkFormatterFactory();
92
-		$entityIdHtmlLinkFormatter = $entityIdHtmlLinkFormatterFactory->getEntityIdFormatter( $language );
92
+		$entityIdHtmlLinkFormatter = $entityIdHtmlLinkFormatterFactory->getEntityIdFormatter($language);
93 93
 		$entityIdLabelFormatterFactory = new EntityIdLabelFormatterFactory();
94
-		$entityIdLabelFormatter = $entityIdLabelFormatterFactory->getEntityIdFormatter( $language );
94
+		$entityIdLabelFormatter = $entityIdLabelFormatterFactory->getEntityIdFormatter($language);
95 95
 		$config = MediaWikiServices::getInstance()->getMainConfig();
96 96
 		$dataFactory = MediaWikiServices::getInstance()->getStatsdDataFactory();
97 97
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 			$prefix,
114 114
 			$repo->getEntityIdParser(),
115 115
 			$repo->getStatementGuidValidator(),
116
-			$repo->getApiHelperFactory( RequestContext::getMain() ),
116
+			$repo->getApiHelperFactory(RequestContext::getMain()),
117 117
 			$resultsSource,
118 118
 			$checkResultsRenderer,
119 119
 			$dataFactory
@@ -142,11 +142,11 @@  discard block
 block discarded – undo
142 142
 		CheckResultsRenderer $checkResultsRenderer,
143 143
 		IBufferingStatsdDataFactory $dataFactory
144 144
 	) {
145
-		parent::__construct( $main, $name, $prefix );
145
+		parent::__construct($main, $name, $prefix);
146 146
 		$this->entityIdParser = $entityIdParser;
147 147
 		$this->statementGuidValidator = $statementGuidValidator;
148
-		$this->resultBuilder = $apiHelperFactory->getResultBuilder( $this );
149
-		$this->errorReporter = $apiHelperFactory->getErrorReporter( $this );
148
+		$this->resultBuilder = $apiHelperFactory->getResultBuilder($this);
149
+		$this->errorReporter = $apiHelperFactory->getErrorReporter($this);
150 150
 		$this->resultsSource = $resultsSource;
151 151
 		$this->checkResultsRenderer = $checkResultsRenderer;
152 152
 		$this->dataFactory = $dataFactory;
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
 
163 163
 		$params = $this->extractRequestParams();
164 164
 
165
-		$this->validateParameters( $params );
166
-		$entityIds = $this->parseEntityIds( $params );
167
-		$claimIds = $this->parseClaimIds( $params );
165
+		$this->validateParameters($params);
166
+		$entityIds = $this->parseEntityIds($params);
167
+		$claimIds = $this->parseClaimIds($params);
168 168
 		$constraintIDs = $params[self::PARAM_CONSTRAINT_ID];
169 169
 		$statuses = $params[self::PARAM_STATUS];
170 170
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 				)
181 181
 			)->getArray()
182 182
 		);
183
-		$this->resultBuilder->markSuccess( 1 );
183
+		$this->resultBuilder->markSuccess(1);
184 184
 	}
185 185
 
186 186
 	/**
@@ -188,24 +188,24 @@  discard block
 block discarded – undo
188 188
 	 *
189 189
 	 * @return EntityId[]
190 190
 	 */
191
-	private function parseEntityIds( array $params ) {
191
+	private function parseEntityIds(array $params) {
192 192
 		$ids = $params[self::PARAM_ID];
193 193
 
194
-		if ( $ids === null ) {
194
+		if ($ids === null) {
195 195
 			return [];
196
-		} elseif ( $ids === [] ) {
196
+		} elseif ($ids === []) {
197 197
 			$this->errorReporter->dieError(
198
-				'If ' . self::PARAM_ID . ' is specified, it must be nonempty.', 'no-data' );
198
+				'If '.self::PARAM_ID.' is specified, it must be nonempty.', 'no-data' );
199 199
 		}
200 200
 
201
-		return array_map( function ( $id ) {
201
+		return array_map(function($id) {
202 202
 			try {
203
-				return $this->entityIdParser->parse( $id );
204
-			} catch ( EntityIdParsingException $e ) {
203
+				return $this->entityIdParser->parse($id);
204
+			} catch (EntityIdParsingException $e) {
205 205
 				$this->errorReporter->dieError(
206
-					"Invalid id: $id", 'invalid-entity-id', 0, [ self::PARAM_ID => $id ] );
206
+					"Invalid id: $id", 'invalid-entity-id', 0, [self::PARAM_ID => $id] );
207 207
 			}
208
-		}, $ids );
208
+		}, $ids);
209 209
 	}
210 210
 
211 211
 	/**
@@ -213,35 +213,35 @@  discard block
 block discarded – undo
213 213
 	 *
214 214
 	 * @return string[]
215 215
 	 */
216
-	private function parseClaimIds( array $params ) {
216
+	private function parseClaimIds(array $params) {
217 217
 		$ids = $params[self::PARAM_CLAIM_ID];
218 218
 
219
-		if ( $ids === null ) {
219
+		if ($ids === null) {
220 220
 			return [];
221
-		} elseif ( $ids === [] ) {
221
+		} elseif ($ids === []) {
222 222
 			$this->errorReporter->dieError(
223
-				'If ' . self::PARAM_CLAIM_ID . ' is specified, it must be nonempty.', 'no-data' );
223
+				'If '.self::PARAM_CLAIM_ID.' is specified, it must be nonempty.', 'no-data' );
224 224
 		}
225 225
 
226
-		foreach ( $ids as $id ) {
227
-			if ( !$this->statementGuidValidator->validate( $id ) ) {
226
+		foreach ($ids as $id) {
227
+			if (!$this->statementGuidValidator->validate($id)) {
228 228
 				$this->errorReporter->dieError(
229
-					"Invalid claim id: $id", 'invalid-guid', 0, [ self::PARAM_CLAIM_ID => $id ] );
229
+					"Invalid claim id: $id", 'invalid-guid', 0, [self::PARAM_CLAIM_ID => $id] );
230 230
 			}
231 231
 		}
232 232
 
233 233
 		return $ids;
234 234
 	}
235 235
 
236
-	private function validateParameters( array $params ) {
237
-		if ( $params[self::PARAM_CONSTRAINT_ID] !== null
238
-			 && empty( $params[self::PARAM_CONSTRAINT_ID] )
236
+	private function validateParameters(array $params) {
237
+		if ($params[self::PARAM_CONSTRAINT_ID] !== null
238
+			 && empty($params[self::PARAM_CONSTRAINT_ID])
239 239
 		) {
240 240
 			$paramConstraintId = self::PARAM_CONSTRAINT_ID;
241 241
 			$this->errorReporter->dieError(
242 242
 				"If $paramConstraintId is specified, it must be nonempty.", 'no-data' );
243 243
 		}
244
-		if ( $params[self::PARAM_ID] === null && $params[self::PARAM_CLAIM_ID] === null ) {
244
+		if ($params[self::PARAM_ID] === null && $params[self::PARAM_CLAIM_ID] === null) {
245 245
 			$paramId = self::PARAM_ID;
246 246
 			$paramClaimId = self::PARAM_CLAIM_ID;
247 247
 			$this->errorReporter->dieError(
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 				],
283 283
 				ApiBase::PARAM_ISMULTI => true,
284 284
 				ApiBase::PARAM_ALL => true,
285
-				ApiBase::PARAM_DFLT => implode( '|', CachingResultsSource::CACHED_STATUSES ),
285
+				ApiBase::PARAM_DFLT => implode('|', CachingResultsSource::CACHED_STATUSES),
286 286
 				ApiBase::PARAM_HELP_MSG_PER_VALUE => [],
287 287
 			],
288 288
 		];
Please login to merge, or discard this patch.
src/Api/CachingResultsSource.php 1 patch
Spacing   +77 added lines, -78 removed lines patch added patch discarded remove patch
@@ -143,14 +143,14 @@  discard block
 block discarded – undo
143 143
 	) {
144 144
 		$results = [];
145 145
 		$metadatas = [];
146
-		if ( $this->canUseStoredResults( $entityIds, $claimIds, $constraintIds, $statuses ) ) {
146
+		if ($this->canUseStoredResults($entityIds, $claimIds, $constraintIds, $statuses)) {
147 147
 			$storedEntityIds = [];
148
-			foreach ( $entityIds as $entityId ) {
149
-				$storedResults = $this->getStoredResults( $entityId );
150
-				if ( $storedResults !== null ) {
151
-					$this->loggingHelper->logCheckConstraintsCacheHit( $entityId );
152
-					foreach ( $storedResults->getArray() as $checkResult ) {
153
-						if ( $this->statusSelected( $statuses, $checkResult ) ) {
148
+			foreach ($entityIds as $entityId) {
149
+				$storedResults = $this->getStoredResults($entityId);
150
+				if ($storedResults !== null) {
151
+					$this->loggingHelper->logCheckConstraintsCacheHit($entityId);
152
+					foreach ($storedResults->getArray() as $checkResult) {
153
+						if ($this->statusSelected($statuses, $checkResult)) {
154 154
 							$results[] = $checkResult;
155 155
 						}
156 156
 					}
@@ -158,19 +158,19 @@  discard block
 block discarded – undo
158 158
 					$storedEntityIds[] = $entityId;
159 159
 				}
160 160
 			}
161
-			$entityIds = array_values( array_diff( $entityIds, $storedEntityIds ) );
161
+			$entityIds = array_values(array_diff($entityIds, $storedEntityIds));
162 162
 		}
163
-		if ( $entityIds !== [] || $claimIds !== [] ) {
164
-			if ( $entityIds !== [] ) {
165
-				$this->loggingHelper->logCheckConstraintsCacheMisses( $entityIds );
163
+		if ($entityIds !== [] || $claimIds !== []) {
164
+			if ($entityIds !== []) {
165
+				$this->loggingHelper->logCheckConstraintsCacheMisses($entityIds);
166 166
 			}
167
-			$response = $this->getAndStoreResults( $entityIds, $claimIds, $constraintIds, $statuses );
168
-			$results = array_merge( $results, $response->getArray() );
167
+			$response = $this->getAndStoreResults($entityIds, $claimIds, $constraintIds, $statuses);
168
+			$results = array_merge($results, $response->getArray());
169 169
 			$metadatas[] = $response->getMetadata();
170 170
 		}
171 171
 		return new CachedCheckResults(
172 172
 			$results,
173
-			Metadata::merge( $metadatas )
173
+			Metadata::merge($metadatas)
174 174
 		);
175 175
 	}
176 176
 
@@ -193,13 +193,13 @@  discard block
 block discarded – undo
193 193
 		?array $constraintIds,
194 194
 		array $statuses
195 195
 	) {
196
-		if ( $claimIds !== [] ) {
196
+		if ($claimIds !== []) {
197 197
 			return false;
198 198
 		}
199
-		if ( $constraintIds !== null ) {
199
+		if ($constraintIds !== null) {
200 200
 			return false;
201 201
 		}
202
-		if ( array_diff( $statuses, self::CACHED_STATUSES ) !== [] ) {
202
+		if (array_diff($statuses, self::CACHED_STATUSES) !== []) {
203 203
 			return false;
204 204
 		}
205 205
 		return true;
@@ -214,8 +214,8 @@  discard block
 block discarded – undo
214 214
 	 * @param CheckResult $result
215 215
 	 * @return bool
216 216
 	 */
217
-	private function statusSelected( array $statuses, CheckResult $result ) {
218
-		return in_array( $result->getStatus(), $statuses, true ) ||
217
+	private function statusSelected(array $statuses, CheckResult $result) {
218
+		return in_array($result->getStatus(), $statuses, true) ||
219 219
 			$result instanceof NullResult;
220 220
 	}
221 221
 
@@ -232,11 +232,11 @@  discard block
 block discarded – undo
232 232
 		?array $constraintIds,
233 233
 		array $statuses
234 234
 	) {
235
-		$results = $this->resultsSource->getResults( $entityIds, $claimIds, $constraintIds, $statuses );
235
+		$results = $this->resultsSource->getResults($entityIds, $claimIds, $constraintIds, $statuses);
236 236
 
237
-		if ( $this->canStoreResults( $entityIds, $claimIds, $constraintIds, $statuses ) ) {
238
-			foreach ( $entityIds as $entityId ) {
239
-				$this->storeResults( $entityId, $results );
237
+		if ($this->canStoreResults($entityIds, $claimIds, $constraintIds, $statuses)) {
238
+			foreach ($entityIds as $entityId) {
239
+				$this->storeResults($entityId, $results);
240 240
 			}
241 241
 		}
242 242
 
@@ -267,10 +267,10 @@  discard block
 block discarded – undo
267 267
 		?array $constraintIds,
268 268
 		array $statuses
269 269
 	) {
270
-		if ( $constraintIds !== null ) {
270
+		if ($constraintIds !== null) {
271 271
 			return false;
272 272
 		}
273
-		if ( array_diff( self::CACHED_STATUSES, $statuses ) !== [] ) {
273
+		if (array_diff(self::CACHED_STATUSES, $statuses) !== []) {
274 274
 			return false;
275 275
 		}
276 276
 		return true;
@@ -284,21 +284,21 @@  discard block
 block discarded – undo
284 284
 	 * May include check results for other entity IDs as well,
285 285
 	 * or check results with statuses that we’re not interested in caching.
286 286
 	 */
287
-	private function storeResults( EntityId $entityId, CachedCheckResults $results ) {
287
+	private function storeResults(EntityId $entityId, CachedCheckResults $results) {
288 288
 		$latestRevisionIds = $this->getLatestRevisionIds(
289 289
 			$results->getMetadata()->getDependencyMetadata()->getEntityIds()
290 290
 		);
291
-		if ( $latestRevisionIds === null ) {
291
+		if ($latestRevisionIds === null) {
292 292
 			return;
293 293
 		}
294 294
 
295 295
 		$resultSerializations = [];
296
-		foreach ( $results->getArray() as $checkResult ) {
297
-			if ( $checkResult->getContextCursor()->getEntityId() !== $entityId->getSerialization() ) {
296
+		foreach ($results->getArray() as $checkResult) {
297
+			if ($checkResult->getContextCursor()->getEntityId() !== $entityId->getSerialization()) {
298 298
 				continue;
299 299
 			}
300
-			if ( $this->statusSelected( self::CACHED_STATUSES, $checkResult ) ) {
301
-				$resultSerializations[] = $this->checkResultSerializer->serialize( $checkResult );
300
+			if ($this->statusSelected(self::CACHED_STATUSES, $checkResult)) {
301
+				$resultSerializations[] = $this->checkResultSerializer->serialize($checkResult);
302 302
 			}
303 303
 		}
304 304
 
@@ -307,11 +307,11 @@  discard block
 block discarded – undo
307 307
 			'latestRevisionIds' => $latestRevisionIds,
308 308
 		];
309 309
 		$futureTime = $results->getMetadata()->getDependencyMetadata()->getFutureTime();
310
-		if ( $futureTime !== null ) {
310
+		if ($futureTime !== null) {
311 311
 			$value['futureTime'] = $futureTime->getArrayValue();
312 312
 		}
313 313
 
314
-		$this->cache->set( $entityId, $value, $this->ttlInSeconds );
314
+		$this->cache->set($entityId, $value, $this->ttlInSeconds);
315 315
 	}
316 316
 
317 317
 	/**
@@ -325,31 +325,30 @@  discard block
 block discarded – undo
325 325
 		EntityId $entityId,
326 326
 		$forRevision = 0
327 327
 	) {
328
-		$value = $this->cache->get( $entityId, $curTTL, [], $asOf );
329
-		$now = call_user_func( $this->microtime, true );
328
+		$value = $this->cache->get($entityId, $curTTL, [], $asOf);
329
+		$now = call_user_func($this->microtime, true);
330 330
 
331
-		$dependencyMetadata = $this->checkDependencyMetadata( $value,
332
-			[ $entityId->getSerialization() => $forRevision ] );
333
-		if ( $dependencyMetadata === null ) {
331
+		$dependencyMetadata = $this->checkDependencyMetadata($value,
332
+			[$entityId->getSerialization() => $forRevision]);
333
+		if ($dependencyMetadata === null) {
334 334
 			return null;
335 335
 		}
336 336
 
337
-		$ageInSeconds = (int)ceil( $now - $asOf );
337
+		$ageInSeconds = (int) ceil($now - $asOf);
338 338
 		$cachingMetadata = $ageInSeconds > 0 ?
339
-			CachingMetadata::ofMaximumAgeInSeconds( $ageInSeconds ) :
340
-			CachingMetadata::fresh();
339
+			CachingMetadata::ofMaximumAgeInSeconds($ageInSeconds) : CachingMetadata::fresh();
341 340
 
342 341
 		$results = [];
343
-		foreach ( $value['results'] as $resultSerialization ) {
344
-			$results[] = $this->deserializeCheckResult( $resultSerialization, $cachingMetadata );
342
+		foreach ($value['results'] as $resultSerialization) {
343
+			$results[] = $this->deserializeCheckResult($resultSerialization, $cachingMetadata);
345 344
 		}
346 345
 
347 346
 		return new CachedCheckResults(
348 347
 			$results,
349
-			Metadata::merge( [
350
-				Metadata::ofCachingMetadata( $cachingMetadata ),
351
-				Metadata::ofDependencyMetadata( $dependencyMetadata ),
352
-			] )
348
+			Metadata::merge([
349
+				Metadata::ofCachingMetadata($cachingMetadata),
350
+				Metadata::ofDependencyMetadata($dependencyMetadata),
351
+			])
353 352
 		);
354 353
 	}
355 354
 
@@ -365,43 +364,43 @@  discard block
 block discarded – undo
365 364
 	 * @return DependencyMetadata|null the dependency metadata,
366 365
 	 * or null if $value should no longer be used
367 366
 	 */
368
-	private function checkDependencyMetadata( $value, $paramRevs ) {
369
-		if ( $value === false ) {
367
+	private function checkDependencyMetadata($value, $paramRevs) {
368
+		if ($value === false) {
370 369
 			return null;
371 370
 		}
372 371
 
373
-		if ( array_key_exists( 'futureTime', $value ) ) {
374
-			$futureTime = TimeValue::newFromArray( $value['futureTime'] );
375
-			if ( !$this->timeValueComparer->isFutureTime( $futureTime ) ) {
372
+		if (array_key_exists('futureTime', $value)) {
373
+			$futureTime = TimeValue::newFromArray($value['futureTime']);
374
+			if (!$this->timeValueComparer->isFutureTime($futureTime)) {
376 375
 				return null;
377 376
 			}
378
-			$futureTimeDependencyMetadata = DependencyMetadata::ofFutureTime( $futureTime );
377
+			$futureTimeDependencyMetadata = DependencyMetadata::ofFutureTime($futureTime);
379 378
 		} else {
380 379
 			$futureTimeDependencyMetadata = DependencyMetadata::blank();
381 380
 		}
382 381
 
383
-		foreach ( $paramRevs as $id => $revision ) {
384
-			if ( $revision > 0 ) {
385
-				$value['latestRevisionIds'][$id] = min( $revision, $value['latestRevisionIds'][$id] ?? PHP_INT_MAX );
382
+		foreach ($paramRevs as $id => $revision) {
383
+			if ($revision > 0) {
384
+				$value['latestRevisionIds'][$id] = min($revision, $value['latestRevisionIds'][$id] ?? PHP_INT_MAX);
386 385
 			}
387 386
 		}
388 387
 
389 388
 		$dependedEntityIds = array_map(
390
-			[ $this->entityIdParser, "parse" ],
391
-			array_keys( $value['latestRevisionIds'] )
389
+			[$this->entityIdParser, "parse"],
390
+			array_keys($value['latestRevisionIds'])
392 391
 		);
393 392
 
394
-		if ( $value['latestRevisionIds'] !== $this->getLatestRevisionIds( $dependedEntityIds ) ) {
393
+		if ($value['latestRevisionIds'] !== $this->getLatestRevisionIds($dependedEntityIds)) {
395 394
 			return null;
396 395
 		}
397 396
 
398 397
 		return array_reduce(
399 398
 			$dependedEntityIds,
400
-			function( DependencyMetadata $metadata, EntityId $entityId ) {
401
-				return DependencyMetadata::merge( [
399
+			function(DependencyMetadata $metadata, EntityId $entityId) {
400
+				return DependencyMetadata::merge([
402 401
 					$metadata,
403
-					DependencyMetadata::ofEntityId( $entityId )
404
-				] );
402
+					DependencyMetadata::ofEntityId($entityId)
403
+				]);
405 404
 			},
406 405
 			$futureTimeDependencyMetadata
407 406
 		);
@@ -421,13 +420,13 @@  discard block
 block discarded – undo
421 420
 		array $resultSerialization,
422 421
 		CachingMetadata $cachingMetadata
423 422
 	) {
424
-		$result = $this->checkResultDeserializer->deserialize( $resultSerialization );
425
-		if ( $this->isPossiblyStaleResult( $result ) ) {
423
+		$result = $this->checkResultDeserializer->deserialize($resultSerialization);
424
+		if ($this->isPossiblyStaleResult($result)) {
426 425
 			$result->withMetadata(
427
-				Metadata::merge( [
426
+				Metadata::merge([
428 427
 					$result->getMetadata(),
429
-					Metadata::ofCachingMetadata( $cachingMetadata ),
430
-				] )
428
+					Metadata::ofCachingMetadata($cachingMetadata),
429
+				])
431 430
 			);
432 431
 		}
433 432
 		return $result;
@@ -437,8 +436,8 @@  discard block
 block discarded – undo
437 436
 	 * @param CheckResult $result
438 437
 	 * @return bool
439 438
 	 */
440
-	private function isPossiblyStaleResult( CheckResult $result ) {
441
-		if ( $result instanceof NullResult ) {
439
+	private function isPossiblyStaleResult(CheckResult $result) {
440
+		if ($result instanceof NullResult) {
442 441
 			return false;
443 442
 		}
444 443
 
@@ -453,14 +452,14 @@  discard block
 block discarded – undo
453 452
 	 * @return int[]|null array from entity ID serializations to revision ID,
454 453
 	 * or null to indicate that not all revision IDs could be loaded
455 454
 	 */
456
-	private function getLatestRevisionIds( array $entityIds ) {
457
-		if ( $entityIds === [] ) {
455
+	private function getLatestRevisionIds(array $entityIds) {
456
+		if ($entityIds === []) {
458 457
 			$this->loggingHelper->logEmptyDependencyMetadata();
459 458
 			return [];
460 459
 		}
461
-		if ( count( $entityIds ) > $this->maxRevisionIds ) {
460
+		if (count($entityIds) > $this->maxRevisionIds) {
462 461
 			// one of those entities will probably be edited soon, so might as well skip caching
463
-			$this->loggingHelper->logHugeDependencyMetadata( $entityIds, $this->maxRevisionIds );
462
+			$this->loggingHelper->logHugeDependencyMetadata($entityIds, $this->maxRevisionIds);
464 463
 			return null;
465 464
 		}
466 465
 
@@ -468,7 +467,7 @@  discard block
 block discarded – undo
468 467
 			$entityIds,
469 468
 			EntityRevisionLookup::LATEST_FROM_REPLICA
470 469
 		);
471
-		if ( $this->hasFalseElements( $latestRevisionIds ) ) {
470
+		if ($this->hasFalseElements($latestRevisionIds)) {
472 471
 			return null;
473 472
 		}
474 473
 		return $latestRevisionIds;
@@ -478,8 +477,8 @@  discard block
 block discarded – undo
478 477
 	 * @param array $array
479 478
 	 * @return bool
480 479
 	 */
481
-	private function hasFalseElements( array $array ) {
482
-		return in_array( false, $array, true );
480
+	private function hasFalseElements(array $array) {
481
+		return in_array(false, $array, true);
483 482
 	}
484 483
 
485 484
 	/**
@@ -487,7 +486,7 @@  discard block
 block discarded – undo
487 486
 	 *
488 487
 	 * @param callable $microtime
489 488
 	 */
490
-	public function setMicrotimeFunction( callable $microtime ) {
489
+	public function setMicrotimeFunction(callable $microtime) {
491 490
 		$this->microtime = $microtime;
492 491
 	}
493 492
 
Please login to merge, or discard this patch.