r101131 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101130‎ | r101131 | r101132 >
Date:13:34, 28 October 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Small cleanup, the verbosity is making my head hurt
Modified paths:
  • /trunk/extensions/Translate/MessageCollection.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/MessageCollection.php
@@ -476,6 +476,7 @@
477477 return $keys;
478478 }
479479
 480+
480481 /**
481482 * Filters list of keys according to whether the user has accepted them.
482483 * @param $keys \list{String} List of keys to filter.
@@ -484,18 +485,13 @@
485486 * @param $user \int Userid
486487 * @return \list{String} Filtered keys.
487488 */
488 - protected function filterReviewer( array $keys, $condition, $user ) {
 489+ protected function filterReviewer( array $keys, /*bool*/ $condition, /*int*/ $user ) {
489490 $this->loadReviewInfo( $keys );
490 -
491 - if ( $condition === false ) {
492 - $origKeys = $keys;
493 - }
494 -
495 - /*
496 - * This removes messages from the list which have certain
497 - * reviewer (among others)
498 - */
 491+ $origKeys = $keys;
499492 $flipKeys = array_flip( $keys );
 493+
 494+ /* This removes messages from the list which have certain
 495+ * reviewer (among others) */
500496 $user = intval( $user );
501497 foreach ( $this->dbReviewData as $row ) {
502498 if ( intval($row->trr_user) === $user ) {
@@ -505,7 +501,6 @@
506502 }
507503
508504 if ( $condition === false ) {
509 - // List of keys that are missing from $keys
510505 $keys = array_diff( $origKeys, $keys );
511506 }
512507
@@ -519,14 +514,11 @@
520515 * @param $user \int Userid
521516 * @return \list{String} Filtered keys.
522517 */
523 - protected function filterLastTranslator( array $keys, $condition, $user ) {
 518+ protected function filterLastTranslator( array $keys, /*bool*/ $condition, /*int*/ $user ) {
524519 $this->loadData( $keys );
525 -
526 - if ( $condition === false ) {
527 - $origKeys = $keys;
528 - }
529 -
 520+ $origKeys = $keys;
530521 $flipKeys = array_flip( $keys );
 522+
531523 $user = intval( $user );
532524 foreach ( $this->dbData as $row ) {
533525 if ( intval($row->rev_user) === $user ) {
@@ -536,15 +528,12 @@
537529 }
538530
539531 if ( $condition === false ) {
540 - // List of keys that are missing from $keys
541532 $keys = array_diff( $origKeys, $keys );
542533 }
543534
544535 return $keys;
545536 }
546537
547 - /** @} */
548 -
549538 /**
550539 * Takes list of keys and converts them into database format.
551540 * @param $keys \list{String} List of keys in display format.

Status & tagging log