Replace uses of join() by implode()
authorSiebrand Mazeland <siebrand@kitano.nl>
Tue, 8 Mar 2016 08:13:12 +0000 (09:13 +0100)
committerUmherirrender <umherirrender_de.wp@web.de>
Tue, 8 Mar 2016 18:24:16 +0000 (18:24 +0000)
All of core uses implode() consistently now.

Change-Id: Iba50898c64c43f356d1caf8869f484e90d9ff651

34 files changed:
includes/GlobalFunctions.php
includes/OutputPage.php
includes/Title.php
includes/api/ApiBase.php
includes/api/ApiContinuationManager.php
includes/api/ApiHelp.php
includes/api/ApiMain.php
includes/api/ApiParamInfo.php
includes/api/ApiQueryAllLinks.php
includes/api/ApiQueryBacklinks.php
includes/api/ApiQueryBacklinksprop.php
includes/api/ApiQueryFileRepoInfo.php
includes/api/ApiResult.php
includes/api/ApiUpload.php
includes/content/JsonContent.php
includes/db/DatabaseOracle.php
includes/filerepo/ForeignAPIRepo.php
includes/installer/MysqlUpdater.php
includes/parser/Parser.php
includes/search/SearchMssql.php
includes/session/BotPasswordSessionProvider.php
includes/session/Session.php
includes/session/SessionManager.php
includes/utils/MWRestrictions.php
languages/classes/LanguageCu.php
languages/classes/LanguageHy.php
languages/classes/LanguageUk.php
maintenance/benchmarks/Benchmarker.php
maintenance/getConfiguration.php
tests/phpunit/includes/api/RandomImageGenerator.php
tests/phpunit/includes/media/WebPTest.php
tests/phpunit/includes/specialpage/SpecialPageFactoryTest.php
tests/phpunit/structure/ApiDocumentationTest.php
tests/qunit/data/generateJqueryMsgData.php

index e48a399..3fa91fa 100644 (file)
@@ -1738,7 +1738,7 @@ function wfEscapeWikiText( $text ) {
                                $repl2[] = preg_quote( substr( $prot, 0, -1 ), '/' );
                        }
                }
-               $repl2 = $repl2 ? '/\b(' . join( '|', $repl2 ) . '):/i' : '/^(?!)/';
+               $repl2 = $repl2 ? '/\b(' . implode( '|', $repl2 ) . '):/i' : '/^(?!)/';
        }
        $text = substr( strtr( "\n$text", $repl ), 1 );
        $text = preg_replace( $repl2, '$1&#58;', $text );
index dfab03a..11c23f0 100644 (file)
@@ -2069,7 +2069,7 @@ class OutputPage extends ContextSource {
                foreach ( SessionManager::singleton()->getVaryHeaders() as $header => $options ) {
                        $this->addVaryHeader( $header, $options );
                }
-               return 'Vary: ' . join( ', ', array_keys( $this->mVaryHeader ) );
+               return 'Vary: ' . implode( ', ', array_keys( $this->mVaryHeader ) );
        }
 
        /**
index 1a8a5f1..0ac3e46 100644 (file)
@@ -174,7 +174,7 @@ class Title implements LinkTarget {
                // make sure we are using the right one. To detect changes over the course
                // of a request, we remember a fingerprint of the config used to create the
                // codec singleton, and re-create it if the fingerprint doesn't match.
-               $fingerprint = spl_object_hash( $wgContLang ) . '|' . join( '+', $wgLocalInterwikis );
+               $fingerprint = spl_object_hash( $wgContLang ) . '|' . implode( '+', $wgLocalInterwikis );
 
                if ( $fingerprint !== $titleCodecFingerprint ) {
                        $titleCodec = null;
index fe85ddd..85dee2b 100644 (file)
@@ -302,7 +302,7 @@ abstract class ApiBase extends ContextSource {
                                        $qs = $k;
                                        $msg = self::escapeWikiText( $v );
                                        if ( is_array( $msg ) ) {
-                                               $msg = join( ' ', $msg );
+                                               $msg = implode( ' ', $msg );
                                        }
                                }
 
@@ -547,13 +547,13 @@ abstract class ApiBase extends ContextSource {
                        $parent = $module;
                        $manager = $parent->getModuleManager();
                        if ( $manager === null ) {
-                               $errorPath = join( '+', array_slice( $parts, 0, $i ) );
+                               $errorPath = implode( '+', array_slice( $parts, 0, $i ) );
                                $this->dieUsage( "The module \"$errorPath\" has no submodules", 'badmodule' );
                        }
                        $module = $manager->getModule( $parts[$i] );
 
                        if ( $module === null ) {
-                               $errorPath = $i ? join( '+', array_slice( $parts, 0, $i ) ) : $parent->getModuleName();
+                               $errorPath = $i ? implode( '+', array_slice( $parts, 0, $i ) ) : $parent->getModuleName();
                                $this->dieUsage(
                                        "The module \"$errorPath\" does not have a submodule \"{$parts[$i]}\"",
                                        'badmodule'
@@ -2223,7 +2223,7 @@ abstract class ApiBase extends ContextSource {
                Hooks::run( 'APIGetDescription', [ &$this, &$desc ] );
                $desc = self::escapeWikiText( $desc );
                if ( is_array( $desc ) ) {
-                       $desc = join( "\n", $desc );
+                       $desc = implode( "\n", $desc );
                } else {
                        $desc = (string)$desc;
                }
@@ -2309,7 +2309,7 @@ abstract class ApiBase extends ContextSource {
                                        }
                                        return $line;
                                }, $d );
-                               $d = join( ' ', $d );
+                               $d = implode( ' ', $d );
                        }
 
                        if ( isset( $settings[ApiBase::PARAM_HELP_MSG] ) ) {
index 25407bf..8f1bd19 100644 (file)
@@ -137,7 +137,7 @@ class ApiContinuationManager {
                }
                $paramName = $module->encodeParamName( $paramName );
                if ( is_array( $paramValue ) ) {
-                       $paramValue = join( '|', $paramValue );
+                       $paramValue = implode( '|', $paramValue );
                }
                $this->continuationData[$name][$paramName] = $paramValue;
        }
@@ -152,7 +152,7 @@ class ApiContinuationManager {
                $name = $module->getModuleName();
                $paramName = $module->encodeParamName( $paramName );
                if ( is_array( $paramValue ) ) {
-                       $paramValue = join( '|', $paramValue );
+                       $paramValue = implode( '|', $paramValue );
                }
                $this->generatorContinuationData[$name][$paramName] = $paramValue;
        }
@@ -193,7 +193,7 @@ class ApiContinuationManager {
                                $data += $kvp;
                        }
                        $data += $this->generatorParams;
-                       $generatorKeys = join( '|', array_keys( $this->generatorParams ) );
+                       $generatorKeys = implode( '|', array_keys( $this->generatorParams ) );
                } elseif ( $this->generatorContinuationData ) {
                        // All the generator-using modules are complete, but the
                        // generator isn't. Continue the generator and restart the
@@ -204,7 +204,7 @@ class ApiContinuationManager {
                        }
                        $data += $generatorParams;
                        $finishedModules = array_diff( $finishedModules, $this->generatedModules );
-                       $generatorKeys = join( '|', array_keys( $generatorParams ) );
+                       $generatorKeys = implode( '|', array_keys( $generatorParams ) );
                        $batchcomplete = true;
                } else {
                        // Generator and prop modules are all done. Mark it so.
@@ -215,7 +215,7 @@ class ApiContinuationManager {
                // Set 'continue' if any continuation data is set or if the generator
                // still needs to run
                if ( $data || $generatorKeys !== '-' ) {
-                       $data['continue'] = $generatorKeys . '||' . join( '|', $finishedModules );
+                       $data['continue'] = $generatorKeys . '||' . implode( '|', $finishedModules );
                }
 
                return [ $data, $batchcomplete ];
index 349a34d..f2d6329 100644 (file)
@@ -268,7 +268,7 @@ class ApiHelp extends ApiBase {
                                        'level' => $level,
                                        'anchor' => $anchor,
                                        'line' => $header,
-                                       'number' => join( '.', $tocnumber ),
+                                       'number' => implode( '.', $tocnumber ),
                                        'index' => false,
                                ];
                                if ( empty( $options['noheader'] ) ) {
@@ -618,7 +618,7 @@ class ApiHelp extends ApiBase {
                                                                        ->parse();
                                                        }
                                                        if ( $extra ) {
-                                                               $info[] = join( ' ', $extra );
+                                                               $info[] = implode( ' ', $extra );
                                                        }
                                                }
                                        }
@@ -655,7 +655,7 @@ class ApiHelp extends ApiBase {
                                        }
 
                                        if ( $description ) {
-                                               $description = join( '', $description );
+                                               $description = implode( '', $description );
                                                $description = preg_replace( '!\s*</([oud]l)>\s*<\1>\s*!', "\n", $description );
                                                $help['parameters'] .= Html::rawElement( 'dd',
                                                        [ 'class' => 'description' ], $description );
@@ -744,7 +744,7 @@ class ApiHelp extends ApiBase {
 
                        Hooks::run( 'APIHelpModifyOutput', [ $module, &$help, $suboptions, &$haveModules ] );
 
-                       $out .= join( "\n", $help );
+                       $out .= implode( "\n", $help );
                }
 
                return $out;
index d59151a..f09c6f2 100644 (file)
@@ -1225,7 +1225,7 @@ class ApiMain extends ApiBase {
                // If a majority of slaves are too lagged then disallow writes
                $slaveCount = wfGetLB()->getServerCount() - 1;
                if ( $numLagged >= ceil( $slaveCount / 2 ) ) {
-                       $laggedServers = join( ', ', $laggedServers );
+                       $laggedServers = implode( ', ', $laggedServers );
                        wfDebugLog(
                                'api-readonly',
                                "Api request failed as read only because the following DBs are lagged: $laggedServers"
@@ -1443,7 +1443,7 @@ class ApiMain extends ApiBase {
                $ret = $this->getRequest()->getVal( $name );
                if ( $ret === null ) {
                        if ( $this->getRequest()->getArray( $name ) !== null ) {
-                               // See bug 10262 for why we don't just join( '|', ... ) the
+                               // See bug 10262 for why we don't just implode( '|', ... ) the
                                // array.
                                $this->setWarning(
                                        "Parameter '$name' uses unsupported PHP array syntax"
@@ -1637,7 +1637,7 @@ class ApiMain extends ApiBase {
                                        'level' => $level,
                                        'anchor' => 'main/datatypes',
                                        'line' => $header,
-                                       'number' => join( '.', $tocnumber ),
+                                       'number' => implode( '.', $tocnumber ),
                                        'index' => false,
                                ];
                        }
@@ -1656,7 +1656,7 @@ class ApiMain extends ApiBase {
                                        'level' => $level,
                                        'anchor' => 'main/credits',
                                        'line' => $header,
-                                       'number' => join( '.', $tocnumber ),
+                                       'number' => implode( '.', $tocnumber ),
                                        'index' => false,
                                ];
                        }
index 6e44f82..c3c9e21 100644 (file)
@@ -137,7 +137,7 @@ class ApiParamInfo extends ApiBase {
                                foreach ( $msgs as $m ) {
                                        $ret[] = $m->setContext( $this->context )->text();
                                }
-                               $res[$key] = join( "\n\n", $ret );
+                               $res[$key] = implode( "\n\n", $ret );
                                if ( $joinLists ) {
                                        $res[$key] = preg_replace( '!^(([*#:;])[^\n]*)\n\n(?=\2)!m', "$1\n", $res[$key] );
                                }
@@ -148,7 +148,7 @@ class ApiParamInfo extends ApiBase {
                                foreach ( $msgs as $m ) {
                                        $ret[] = $m->setContext( $this->context )->parseAsBlock();
                                }
-                               $ret = join( "\n", $ret );
+                               $ret = implode( "\n", $ret );
                                if ( $joinLists ) {
                                        $ret = preg_replace( '!\s*</([oud]l)>\s*<\1>\s*!', "\n", $ret );
                                }
index 94707da..ac90605 100644 (file)
@@ -117,7 +117,7 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
                        if ( $matches ) {
                                $p = $this->getModulePrefix();
                                $this->dieUsage(
-                                       "Cannot use {$p}prop=" . join( '|', array_keys( $matches ) ) . " with {$p}unique",
+                                       "Cannot use {$p}prop=" . implode( '|', array_keys( $matches ) ) . " with {$p}unique",
                                        'params'
                                );
                        }
index 97b122a..fb502e4 100644 (file)
@@ -296,7 +296,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
                                // Note we must keep the parameters for the first query constant
                                // This may be overridden at a later step
                                $title = $row->{$this->bl_title};
-                               $this->continueStr = join( '|', array_slice( $this->cont, 0, 2 ) ) .
+                               $this->continueStr = implode( '|', array_slice( $this->cont, 0, 2 ) ) .
                                        "|$ns|$title|{$row->from_ns}|{$row->page_id}";
                                break;
                        }
@@ -451,7 +451,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
                                                [ 'query', $this->getModuleName() ],
                                                $idx, array_diff_key( $arr, [ 'redirlinks' => '' ] ) );
                                        if ( !$fit ) {
-                                               $this->continueStr = join( '|', array_slice( $this->cont, 0, 6 ) ) .
+                                               $this->continueStr = implode( '|', array_slice( $this->cont, 0, 6 ) ) .
                                                        "|$pageID";
                                                break;
                                        }
@@ -474,7 +474,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
                                                        [ 'query', $this->getModuleName(), $idx, 'redirlinks' ],
                                                        null, $redir );
                                                if ( !$fit ) {
-                                                       $this->continueStr = join( '|', array_slice( $this->cont, 0, 6 ) ) .
+                                                       $this->continueStr = implode( '|', array_slice( $this->cont, 0, 6 ) ) .
                                                                "|$pageID|$key";
                                                        break;
                                                }
index 5b55332..3810e90 100644 (file)
@@ -313,7 +313,7 @@ class ApiQueryBacklinksprop extends ApiQueryGeneratorBase {
                foreach ( $sortby as $field => $v ) {
                        $cont[] = $row->$field;
                }
-               $this->setContinueEnumParameter( 'continue', join( '|', $cont ) );
+               $this->setContinueEnumParameter( 'continue', implode( '|', $cont ) );
        }
 
        public function getCacheMode( $params ) {
index 7848bc8..c491236 100644 (file)
@@ -78,7 +78,7 @@ class ApiQueryFileRepoInfo extends ApiQueryBase {
 
                return [
                        'prop' => [
-                               ApiBase::PARAM_DFLT => join( '|', $props ),
+                               ApiBase::PARAM_DFLT => implode( '|', $props ),
                                ApiBase::PARAM_ISMULTI => true,
                                ApiBase::PARAM_TYPE => $props,
                        ],
index a5f22c3..3436320 100644 (file)
@@ -312,7 +312,7 @@ class ApiResult implements ApiSerializable {
                        if ( !$conflicts ) {
                                $arr[$name] += $value;
                        } else {
-                               $keys = join( ', ', array_keys( $conflicts ) );
+                               $keys = implode( ', ', array_keys( $conflicts ) );
                                throw new RuntimeException(
                                        "Conflicting keys ($keys) when attempting to merge element $name"
                                );
@@ -1132,12 +1132,12 @@ class ApiResult implements ApiSerializable {
                                                $tmp = [];
                                                return $tmp;
                                        default:
-                                               $fail = join( '.', array_slice( $path, 0, $i + 1 ) );
+                                               $fail = implode( '.', array_slice( $path, 0, $i + 1 ) );
                                                throw new InvalidArgumentException( "Path $fail does not exist" );
                                }
                        }
                        if ( !is_array( $ret[$k] ) ) {
-                               $fail = join( '.', array_slice( $path, 0, $i + 1 ) );
+                               $fail = implode( '.', array_slice( $path, 0, $i + 1 ) );
                                throw new InvalidArgumentException( "Path $fail is not an array" );
                        }
                        $ret = &$ret[$k];
index 0eecaa1..326f8ba 100644 (file)
@@ -544,7 +544,7 @@ class ApiUpload extends ApiBase {
 
                                $msg = 'Filetype not permitted: ';
                                if ( isset( $verification['blacklistedExt'] ) ) {
-                                       $msg .= join( ', ', $verification['blacklistedExt'] );
+                                       $msg .= implode( ', ', $verification['blacklistedExt'] );
                                        $extradata['blacklisted'] = array_values( $verification['blacklistedExt'] );
                                        ApiResult::setIndexedTagName( $extradata['blacklisted'], 'ext' );
                                } else {
index b9215fc..40d9277 100644 (file)
@@ -161,7 +161,7 @@ class JsonContent extends TextContent {
                        );
                }
                return Html::rawElement( 'table', [ 'class' => 'mw-json' ],
-                       Html::rawElement( 'tbody', [], join( '', $rows ) )
+                       Html::rawElement( 'tbody', [], implode( '', $rows ) )
                );
        }
 
@@ -200,7 +200,7 @@ class JsonContent extends TextContent {
                        );
                }
                return Html::rawElement( 'table', [ 'class' => 'mw-json' ],
-                       Html::rawElement( 'tbody', [], join( "\n", $rows ) )
+                       Html::rawElement( 'tbody', [], implode( "\n", $rows ) )
                );
        }
 
index 9b301a9..9e53653 100644 (file)
@@ -618,7 +618,7 @@ class DatabaseOracle extends Database {
 
                $table = $this->tableName( $table );
                // "INSERT INTO tables (a, b, c)"
-               $sql = "INSERT INTO " . $table . " (" . join( ',', array_keys( $row ) ) . ')';
+               $sql = "INSERT INTO " . $table . " (" . implode( ',', array_keys( $row ) ) . ')';
                $sql .= " VALUES (";
 
                // for each value, append ":key"
index d29cd7d..cc9099c 100644 (file)
@@ -537,7 +537,7 @@ class ForeignAPIRepo extends FileRepo {
         * @since 1.23
         */
        protected static function getIIProps() {
-               return join( '|', self::$imageInfoProps );
+               return implode( '|', self::$imageInfoProps );
        }
 
        /**
index 57eaffe..154f7c3 100644 (file)
@@ -516,7 +516,7 @@ class MysqlUpdater extends DatabaseUpdater {
                                $prev_title = $row->cur_title;
                                $prev_namespace = $row->cur_namespace;
                        }
-                       $sql = "DELETE FROM $cur WHERE cur_id IN ( " . join( ',', $deleteId ) . ')';
+                       $sql = "DELETE FROM $cur WHERE cur_id IN ( " . implode( ',', $deleteId ) . ')';
                        $this->db->query( $sql, __METHOD__ );
                        $this->output( wfTimestamp( TS_DB ) );
                        $this->output( "......<b>Deleted</b> " . $this->db->affectedRows() . " records.\n" );
index d65e8be..d7ba266 100644 (file)
@@ -4636,7 +4636,7 @@ class Parser {
                        $anchor = $safeHeadline;
                        $legacyAnchor = $legacyHeadline;
                        if ( isset( $refers[$arrayKey] ) ) {
-                               // @codingStandardsIgnoreStart 
+                               // @codingStandardsIgnoreStart
                                for ( $i = 2; isset( $refers["${arrayKey}_$i"] ); ++$i );
                                // @codingStandardsIgnoreEnd
                                $anchor .= "_$i";
@@ -4645,7 +4645,7 @@ class Parser {
                                $refers[$arrayKey] = true;
                        }
                        if ( $legacyHeadline !== false && isset( $refers[$legacyArrayKey] ) ) {
-                               // @codingStandardsIgnoreStart 
+                               // @codingStandardsIgnoreStart
                                for ( $i = 2; isset( $refers["${legacyArrayKey}_$i"] ); ++$i );
                                // @codingStandardsIgnoreEnd
                                $legacyAnchor .= "_$i";
@@ -4793,7 +4793,7 @@ class Parser {
                        $sections[0] = $sections[0] . $toc . "\n";
                }
 
-               $full .= join( '', $sections );
+               $full .= implode( '', $sections );
 
                if ( $this->mForceTocPosition ) {
                        return str_replace( '<!--MWTOC-->', $toc, $full );
index 598702d..5e8fb04 100644 (file)
@@ -160,7 +160,7 @@ class SearchMssql extends SearchDatabase {
                        }
                }
 
-               $searchon = $this->db->addQuotes( join( ',', $q ) );
+               $searchon = $this->db->addQuotes( implode( ',', $q ) );
                $field = $this->getIndexField( $fulltext );
                return "$field, $searchon";
        }
index 70c771d..bbdfdc3 100644 (file)
@@ -120,7 +120,7 @@ class BotPasswordSessionProvider extends ImmutableSessionProviderWithCookie {
                if ( $missingKeys ) {
                        $this->logger->info( 'Session "{session}": Missing metadata: {missing}', [
                                'session' => $info,
-                               'missing' => join( ', ', $missingKeys ),
+                               'missing' => implode( ', ', $missingKeys ),
                        ] );
                        return false;
                }
index 21db609..0fd8fa8 100644 (file)
@@ -352,7 +352,7 @@ final class Session implements \Countable, \Iterator, \ArrayAccess {
                        $new = true;
                }
                if ( is_array( $salt ) ) {
-                       $salt = join( '|', $salt );
+                       $salt = implode( '|', $salt );
                }
                return new Token( $secret, (string)$salt, $new );
        }
index d31e2f1..efa3445 100644 (file)
@@ -287,7 +287,7 @@ final class SessionManager implements SessionManagerInterface {
                // Make sure there's exactly one
                if ( count( $infos ) > 1 ) {
                        throw new \UnexpectedValueException(
-                               'Multiple empty sessions tied for top priority: ' . join( ', ', $infos )
+                               'Multiple empty sessions tied for top priority: ' . implode( ', ', $infos )
                        );
                } elseif ( count( $infos ) < 1 ) {
                        throw new \UnexpectedValueException( 'No provider could provide an empty session!' );
@@ -677,7 +677,7 @@ final class SessionManager implements SessionManagerInterface {
 
                if ( count( $retInfos ) > 1 ) {
                        $ex = new \OverflowException(
-                               'Multiple sessions for this request tied for top priority: ' . join( ', ', $retInfos )
+                               'Multiple sessions for this request tied for top priority: ' . implode( ', ', $retInfos )
                        );
                        $ex->sessionInfos = $retInfos;
                        throw $ex;
index 521e345..617e8f5 100644 (file)
@@ -69,13 +69,13 @@ class MWRestrictions {
                $invalidKeys = array_diff( $keys, $validKeys );
                if ( $invalidKeys ) {
                        throw new InvalidArgumentException(
-                               'Array contains invalid keys: ' . join( ', ', $invalidKeys )
+                               'Array contains invalid keys: ' . implode( ', ', $invalidKeys )
                        );
                }
                $missingKeys = array_diff( $neededKeys, $keys );
                if ( $missingKeys ) {
                        throw new InvalidArgumentException(
-                               'Array is missing required keys: ' . join( ', ', $missingKeys )
+                               'Array is missing required keys: ' . implode( ', ', $missingKeys )
                        );
                }
 
index b36f080..89625c0 100644 (file)
@@ -52,11 +52,11 @@ class LanguageCu extends Language {
                if ( !preg_match( "/[a-zA-Z_]/us", $word ) ) {
                        switch ( $case ) {
                                case 'genitive': # родительный падеж
-                                       if ( ( join( '', array_slice( $ar[0], -4 ) ) == 'вики' )
-                                               || ( join( '', array_slice( $ar[0], -4 ) ) == 'Вики' )
+                                       if ( ( implode( '', array_slice( $ar[0], -4 ) ) == 'вики' )
+                                               || ( implode( '', array_slice( $ar[0], -4 ) ) == 'Вики' )
                                        ) {
-                                       } elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ї' ) {
-                                               $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'їѩ';
+                                       } elseif ( implode( '', array_slice( $ar[0], -2 ) ) == 'ї' ) {
+                                               $word = implode( '', array_slice( $ar[0], 0, -2 ) ) . 'їѩ';
                                        }
                                        break;
                                case 'accusative': # винительный падеж
index f6d5270..05b0ebe 100644 (file)
@@ -52,12 +52,12 @@ class LanguageHy extends Language {
                if ( !preg_match( "/[a-zA-Z_]/us", $word ) ) {
                        switch ( $case ) {
                                case 'genitive': # սեռական հոլով
-                                       if ( join( '', array_slice( $ar[0], -1 ) ) == 'ա' ) {
-                                               $word = join( '', array_slice( $ar[0], 0, -1 ) ) . 'այի';
-                                       } elseif ( join( '', array_slice( $ar[0], -1 ) ) == 'ո' ) {
-                                               $word = join( '', array_slice( $ar[0], 0, -1 ) ) . 'ոյի';
-                                       } elseif ( join( '', array_slice( $ar[0], -4 ) ) == 'գիրք' ) {
-                                               $word = join( '', array_slice( $ar[0], 0, -4 ) ) . 'գրքի';
+                                       if ( implode( '', array_slice( $ar[0], -1 ) ) == 'ա' ) {
+                                               $word = implode( '', array_slice( $ar[0], 0, -1 ) ) . 'այի';
+                                       } elseif ( implode( '', array_slice( $ar[0], -1 ) ) == 'ո' ) {
+                                               $word = implode( '', array_slice( $ar[0], 0, -1 ) ) . 'ոյի';
+                                       } elseif ( implode( '', array_slice( $ar[0], -4 ) ) == 'գիրք' ) {
+                                               $word = implode( '', array_slice( $ar[0], 0, -4 ) ) . 'գրքի';
                                        } else {
                                                $word .= 'ի';
                                        }
index 6cc23e3..72bde40 100644 (file)
@@ -51,19 +51,19 @@ class LanguageUk extends Language {
                if ( !preg_match( "/[a-zA-Z_]/us", $word ) ) {
                        switch ( $case ) {
                                case 'genitive': # родовий відмінок
-                                       if ( join( '', array_slice( $ar[0], -2 ) ) === 'ія' ) {
-                                               $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'ії';
-                                       } elseif ( join( '', array_slice( $ar[0], -2 ) ) === 'ти' ) {
-                                               $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'т';
-                                       } elseif ( join( '', array_slice( $ar[0], -2 ) ) === 'ди' ) {
-                                               $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'дів';
-                                       } elseif ( join( '', array_slice( $ar[0], -3 ) ) === 'ник' ) {
-                                               $word = join( '', array_slice( $ar[0], 0, -3 ) ) . 'ника';
+                                       if ( implode( '', array_slice( $ar[0], -2 ) ) === 'ія' ) {
+                                               $word = implode( '', array_slice( $ar[0], 0, -2 ) ) . 'ії';
+                                       } elseif ( implode( '', array_slice( $ar[0], -2 ) ) === 'ти' ) {
+                                               $word = implode( '', array_slice( $ar[0], 0, -2 ) ) . 'т';
+                                       } elseif ( implode( '', array_slice( $ar[0], -2 ) ) === 'ди' ) {
+                                               $word = implode( '', array_slice( $ar[0], 0, -2 ) ) . 'дів';
+                                       } elseif ( implode( '', array_slice( $ar[0], -3 ) ) === 'ник' ) {
+                                               $word = implode( '', array_slice( $ar[0], 0, -3 ) ) . 'ника';
                                        }
                                        break;
                                case 'accusative': # знахідний відмінок
-                                       if ( join( '', array_slice( $ar[0], -2 ) ) === 'ія' ) {
-                                               $word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'ію';
+                                       if ( implode( '', array_slice( $ar[0], -2 ) ) === 'ія' ) {
+                                               $word = implode( '', array_slice( $ar[0], 0, -2 ) ) . 'ію';
                                        }
                                        break;
                        }
index 8651a68..5fab082 100644 (file)
@@ -87,7 +87,7 @@ abstract class Benchmarker extends Maintenance {
                        $ret .= sprintf( "%s times: function %s(%s) :\n",
                                $res['count'],
                                $res['function'],
-                               join( ', ', $res['arguments'] )
+                               implode( ', ', $res['arguments'] )
                        );
                        $ret .= sprintf( "   %6.2fms (%6.2fms each)\n",
                                $res['delta'] * 1000,
index 6bc9a6a..3c679e6 100644 (file)
@@ -53,7 +53,7 @@ class GetConfiguration extends Maintenance {
                $this->addOption( 'regex', 'regex to filter variables with', false, true );
                $this->addOption( 'iregex', 'same as --regex but case insensitive', false, true );
                $this->addOption( 'settings', 'Space-separated list of wg* variables', false, true );
-               $this->addOption( 'format', join( ', ', self::$outFormats ), false, true );
+               $this->addOption( 'format', implode( ', ', self::$outFormats ), false, true );
        }
 
        protected function validateParamsAndArgs() {
index 62e175b..78cb7fb 100644 (file)
@@ -230,7 +230,7 @@ class RandomImageGenerator {
                        $points[] = $point['x'] . ',' . $point['y'];
                }
 
-               return join( " ", $points );
+               return implode( " ", $points );
        }
 
        /**
@@ -425,7 +425,7 @@ class RandomImageGenerator {
                        $components[] = mt_rand( 0, 255 );
                }
 
-               return 'rgb(' . join( ', ', $components ) . ')';
+               return 'rgb(' . implode( ', ', $components ) . ')';
        }
 
        /**
index b50fe80..dfa92f1 100644 (file)
@@ -137,5 +137,5 @@ class WebPHandlerTest extends MediaWikiTestCase {
 }
 
 /* Python code to extract a header and convert to PHP format:
- * print '"%s"' % ''.join( '\\x%02X' % ord(c) for c in urllib.urlopen(url).read(36) )
+ * print '"%s"' % ''.implode( '\\x%02X' % ord(c) for c in urllib.urlopen(url).read(36) )
  */
index 998d2bb..534cf9b 100644 (file)
@@ -171,7 +171,7 @@ class SpecialPageFactoryTest extends MediaWikiTestCase {
                $gotWarnings = count( $warnings );
                if ( $gotWarnings !== $expectWarnings ) {
                        $this->fail( "Expected $expectWarnings warning(s), but got $gotWarnings:\n" .
-                               join( "\n", $warnings )
+                               implode( "\n", $warnings )
                        );
                }
        }
index b9cb6c1..542420a 100644 (file)
@@ -153,7 +153,7 @@ class ApiDocumentationTest extends MediaWikiTestCase {
                                foreach ( $globals as $k => $v ) {
                                        $g[] = "$k=" . var_export( $v, 1 );
                                }
-                               $k = "Module $path with " . join( ', ', $g );
+                               $k = "Module $path with " . implode( ', ', $g );
                                $ret[$k] = [ $path, $globals ];
                        }
                }
index 456787c..5a96dc3 100644 (file)
@@ -110,7 +110,7 @@ class GenerateJqueryMsgData extends Maintenance {
                                        $langKey = $languageCode . '_' . $key;
                                        $messages[$langKey] = $template;
                                        $tests[] = [
-                                               'name' => $languageCode . ' ' . $key . ' ' . join( ',', $args ),
+                                               'name' => $languageCode . ' ' . $key . ' ' . implode( ',', $args ),
                                                'key' => $langKey,
                                                'args' => $args,
                                                'result' => $result,