Index: trunk/extensions/Translate/MessageCollection.php |
— | — | @@ -476,6 +476,7 @@ |
477 | 477 | return $keys; |
478 | 478 | } |
479 | 479 | |
| 480 | + |
480 | 481 | /** |
481 | 482 | * Filters list of keys according to whether the user has accepted them. |
482 | 483 | * @param $keys \list{String} List of keys to filter. |
— | — | @@ -484,18 +485,13 @@ |
485 | 486 | * @param $user \int Userid |
486 | 487 | * @return \list{String} Filtered keys. |
487 | 488 | */ |
488 | | - protected function filterReviewer( array $keys, $condition, $user ) { |
| 489 | + protected function filterReviewer( array $keys, /*bool*/ $condition, /*int*/ $user ) { |
489 | 490 | $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; |
499 | 492 | $flipKeys = array_flip( $keys ); |
| 493 | + |
| 494 | + /* This removes messages from the list which have certain |
| 495 | + * reviewer (among others) */ |
500 | 496 | $user = intval( $user ); |
501 | 497 | foreach ( $this->dbReviewData as $row ) { |
502 | 498 | if ( intval($row->trr_user) === $user ) { |
— | — | @@ -505,7 +501,6 @@ |
506 | 502 | } |
507 | 503 | |
508 | 504 | if ( $condition === false ) { |
509 | | - // List of keys that are missing from $keys |
510 | 505 | $keys = array_diff( $origKeys, $keys ); |
511 | 506 | } |
512 | 507 | |
— | — | @@ -519,14 +514,11 @@ |
520 | 515 | * @param $user \int Userid |
521 | 516 | * @return \list{String} Filtered keys. |
522 | 517 | */ |
523 | | - protected function filterLastTranslator( array $keys, $condition, $user ) { |
| 518 | + protected function filterLastTranslator( array $keys, /*bool*/ $condition, /*int*/ $user ) { |
524 | 519 | $this->loadData( $keys ); |
525 | | - |
526 | | - if ( $condition === false ) { |
527 | | - $origKeys = $keys; |
528 | | - } |
529 | | - |
| 520 | + $origKeys = $keys; |
530 | 521 | $flipKeys = array_flip( $keys ); |
| 522 | + |
531 | 523 | $user = intval( $user ); |
532 | 524 | foreach ( $this->dbData as $row ) { |
533 | 525 | if ( intval($row->rev_user) === $user ) { |
— | — | @@ -536,15 +528,12 @@ |
537 | 529 | } |
538 | 530 | |
539 | 531 | if ( $condition === false ) { |
540 | | - // List of keys that are missing from $keys |
541 | 532 | $keys = array_diff( $origKeys, $keys ); |
542 | 533 | } |
543 | 534 | |
544 | 535 | return $keys; |
545 | 536 | } |
546 | 537 | |
547 | | - /** @} */ |
548 | | - |
549 | 538 | /** |
550 | 539 | * Takes list of keys and converts them into database format. |
551 | 540 | * @param $keys \list{String} List of keys in display format. |