Merge "mediawiki.mixins: Add `hyphens` mixin"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 22 Feb 2018 20:27:25 +0000 (20:27 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 22 Feb 2018 20:27:25 +0000 (20:27 +0000)
includes/EditPage.php
includes/api/ApiCSPReport.php
includes/filerepo/ForeignAPIRepo.php
includes/libs/objectcache/WANObjectCache.php
includes/parser/CoreParserFunctions.php
includes/specials/SpecialEditWatchlist.php
includes/tidy/Balancer.php
maintenance/Maintenance.php
maintenance/language/languages.inc

index ddb4971..e00e930 100644 (file)
@@ -3706,7 +3706,7 @@ ERROR;
                $out->addHTML( $this->editFormTextAfterWarn );
 
                $out->addHTML( "<div class='editButtons'>\n" );
-               $out->addHTML( implode( $this->getEditButtons( $tabindex ), "\n" ) . "\n" );
+               $out->addHTML( implode( "\n", $this->getEditButtons( $tabindex ) ) . "\n" );
 
                $cancel = $this->getCancelLink();
 
index 0df0ca9..af040d1 100644 (file)
@@ -162,7 +162,7 @@ class ApiCSPReport extends ApiBase {
        private function generateLogLine( $flags, $report ) {
                $flagText = '';
                if ( $flags ) {
-                       $flagText = '[' . implode( $flags, ', ' ) . ']';
+                       $flagText = '[' . implode( ', ', $flags ) . ']';
                }
 
                $blockedFile = isset( $report['blocked-uri'] ) ? $report['blocked-uri'] : 'n/a';
index 5a37701..1a86648 100644 (file)
@@ -143,7 +143,7 @@ class ForeignAPIRepo extends FileRepo {
                }
 
                $data = $this->fetchImageQuery( [
-                       'titles' => implode( $files, '|' ),
+                       'titles' => implode( '|', $files ),
                        'prop' => 'imageinfo' ]
                );
 
index bcd95c1..17f596d 100644 (file)
@@ -517,18 +517,18 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
                        // Case B: any long-running transaction; ignore this set()
                        } elseif ( $age > self::MAX_READ_LAG ) {
                                $this->logger->info( 'Rejected set() for {cachekey} due to snapshot lag.',
-                                       [ 'cachekey' => $key ] );
+                                       [ 'cachekey' => $key, 'lag' => $lag, 'age' => $age ] );
 
                                return true; // no-op the write for being unsafe
                        // Case C: high replication lag; lower TTL instead of ignoring all set()s
                        } elseif ( $lag === false || $lag > self::MAX_READ_LAG ) {
                                $ttl = $ttl ? min( $ttl, self::TTL_LAGGED ) : self::TTL_LAGGED;
                                $this->logger->warning( 'Lowered set() TTL for {cachekey} due to replication lag.',
-                                       [ 'cachekey' => $key ] );
+                                       [ 'cachekey' => $key, 'lag' => $lag, 'age' => $age ] );
                        // Case D: medium length request with medium replication lag; ignore this set()
                        } else {
                                $this->logger->info( 'Rejected set() for {cachekey} due to high read lag.',
-                                       [ 'cachekey' => $key ] );
+                                       [ 'cachekey' => $key, 'lag' => $lag, 'age' => $age ] );
 
                                return true; // no-op the write for being unsafe
                        }
index c6a10ae..d408c7f 100644 (file)
@@ -830,7 +830,7 @@ class CoreParserFunctions {
                        $restrictions = $titleObject->getRestrictions( strtolower( $type ) );
                        # Title::getRestrictions returns an array, its possible it may have
                        # multiple values in the future
-                       return implode( $restrictions, ',' );
+                       return implode( ',', $restrictions );
                }
                return '';
        }
@@ -1339,7 +1339,7 @@ class CoreParserFunctions {
                        foreach ( $sources[0] as $sourceTitle ) {
                                $names[] = $sourceTitle->getPrefixedText();
                        }
-                       return implode( $names, '|' );
+                       return implode( '|', $names );
                }
                return '';
        }
index 0a38ad1..f702bc0 100644 (file)
@@ -657,7 +657,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
         * @return HTMLForm
         */
        protected function getRawForm() {
-               $titles = implode( $this->getWatchlist(), "\n" );
+               $titles = implode( "\n", $this->getWatchlist() );
                $fields = [
                        'Titles' => [
                                'type' => 'textarea',
index fa89c1a..c7d9a26 100644 (file)
@@ -1366,7 +1366,7 @@ class BalanceStack implements IteratorAggregate {
                foreach ( $this->elements as $elt ) {
                        array_push( $r, $elt->localName );
                }
-               return implode( $r, ' ' );
+               return implode( ' ', $r );
        }
 }
 
@@ -1904,7 +1904,7 @@ class Balancer {
                                }
                        );
                        if ( count( $bad ) > 0 ) {
-                               $badstr = implode( array_keys( $bad ), ',' );
+                               $badstr = implode( ',', array_keys( $bad ) );
                                throw new ParameterAssertionException(
                                        '$config',
                                        'Balance attempted with sanitization including ' .
index 7e4bf7c..c91fbb4 100644 (file)
@@ -1011,7 +1011,7 @@ abstract class Maintenance {
 
                // ... append parameters ...
                if ( $this->mParams ) {
-                       $output .= " [--" . implode( array_keys( $this->mParams ), "|--" ) . "]";
+                       $output .= " [--" . implode( "|--", array_keys( $this->mParams ) ) . "]";
                }
 
                // ... and append arguments.
index ad80af5..c8fb629 100644 (file)
@@ -558,7 +558,7 @@ class Languages {
                        }
 
                        if ( isset( $messages[$key] ) ) {
-                               $messages[$key] = implode( $messages[$key], ", " );
+                               $messages[$key] = implode( ", ", $messages[$key] );
                        }
                }