Siebrand has uploaded a new change for review.
https://gerrit.wikimedia.org/r/275770
Change subject: Replace uses of join() by implode()
......................................................................
Replace uses of join() by implode()
All of core uses implode() consistently now.
Change-Id: Iba50898c64c43f356d1caf8869f484e90d9ff651
---
M includes/GlobalFunctions.php
M includes/OutputPage.php
M includes/Title.php
M includes/api/ApiBase.php
M includes/api/ApiContinuationManager.php
M includes/api/ApiHelp.php
M includes/api/ApiMain.php
M includes/api/ApiParamInfo.php
M includes/api/ApiQueryAllLinks.php
M includes/api/ApiQueryBacklinks.php
M includes/api/ApiQueryBacklinksprop.php
M includes/api/ApiQueryFileRepoInfo.php
M includes/api/ApiResult.php
M includes/api/ApiUpload.php
M includes/content/JsonContent.php
M includes/db/DatabaseOracle.php
M includes/filerepo/ForeignAPIRepo.php
M includes/installer/MysqlUpdater.php
M includes/parser/Parser.php
M includes/search/SearchMssql.php
M includes/session/BotPasswordSessionProvider.php
M includes/session/Session.php
M includes/session/SessionManager.php
M includes/utils/MWRestrictions.php
M languages/classes/LanguageCu.php
M languages/classes/LanguageHy.php
M languages/classes/LanguageUk.php
M maintenance/benchmarks/Benchmarker.php
M maintenance/getConfiguration.php
M tests/phpunit/includes/api/RandomImageGenerator.php
M tests/phpunit/includes/media/WebPTest.php
M tests/phpunit/includes/specialpage/SpecialPageFactoryTest.php
M tests/phpunit/structure/ApiDocumentationTest.php
M tests/qunit/data/generateJqueryMsgData.php
34 files changed, 76 insertions(+), 76 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/70/275770/1
diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index e48a399..3fa91fa 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -1738,7 +1738,7 @@
$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:', $text );
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 5d1d5d0..836cf9e 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -2069,7 +2069,7 @@
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
) );
}
/**
diff --git a/includes/Title.php b/includes/Title.php
index c0ec97f..66f51c0 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -174,7 +174,7 @@
// 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;
diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php
index b5dd729..3d4fdd5 100644
--- a/includes/api/ApiBase.php
+++ b/includes/api/ApiBase.php
@@ -302,7 +302,7 @@
$qs = $k;
$msg = self::escapeWikiText( $v );
if ( is_array( $msg ) ) {
- $msg = join( ' ', $msg );
+ $msg = implode( ' ', $msg );
}
}
@@ -547,13 +547,13 @@
$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 @@
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 @@
}
return $line;
}, $d );
- $d = join( ' ', $d );
+ $d = implode( ' ', $d );
}
if ( isset( $settings[ApiBase::PARAM_HELP_MSG] ) ) {
diff --git a/includes/api/ApiContinuationManager.php
b/includes/api/ApiContinuationManager.php
index 25407bf..8f1bd19 100644
--- a/includes/api/ApiContinuationManager.php
+++ b/includes/api/ApiContinuationManager.php
@@ -137,7 +137,7 @@
}
$paramName = $module->encodeParamName( $paramName );
if ( is_array( $paramValue ) ) {
- $paramValue = join( '|', $paramValue );
+ $paramValue = implode( '|', $paramValue );
}
$this->continuationData[$name][$paramName] = $paramValue;
}
@@ -152,7 +152,7 @@
$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 @@
$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 @@
}
$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 @@
// 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 ];
diff --git a/includes/api/ApiHelp.php b/includes/api/ApiHelp.php
index 349a34d..f2d6329 100644
--- a/includes/api/ApiHelp.php
+++ b/includes/api/ApiHelp.php
@@ -268,7 +268,7 @@
'level' => $level,
'anchor' => $anchor,
'line' => $header,
- 'number' => join( '.', $tocnumber ),
+ 'number' => implode( '.', $tocnumber ),
'index' => false,
];
if ( empty( $options['noheader'] ) ) {
@@ -618,7 +618,7 @@
->parse();
}
if ( $extra ) {
- $info[] = join(
' ', $extra );
+ $info[] =
implode( ' ', $extra );
}
}
}
@@ -655,7 +655,7 @@
}
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 @@
Hooks::run( 'APIHelpModifyOutput', [ $module, &$help,
$suboptions, &$haveModules ] );
- $out .= join( "\n", $help );
+ $out .= implode( "\n", $help );
}
return $out;
diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php
index d59151a..f09c6f2 100644
--- a/includes/api/ApiMain.php
+++ b/includes/api/ApiMain.php
@@ -1225,7 +1225,7 @@
// 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 @@
$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 @@
'level' => $level,
'anchor' => 'main/datatypes',
'line' => $header,
- 'number' => join( '.', $tocnumber ),
+ 'number' => implode( '.', $tocnumber ),
'index' => false,
];
}
@@ -1656,7 +1656,7 @@
'level' => $level,
'anchor' => 'main/credits',
'line' => $header,
- 'number' => join( '.', $tocnumber ),
+ 'number' => implode( '.', $tocnumber ),
'index' => false,
];
}
diff --git a/includes/api/ApiParamInfo.php b/includes/api/ApiParamInfo.php
index 6e44f82..c3c9e21 100644
--- a/includes/api/ApiParamInfo.php
+++ b/includes/api/ApiParamInfo.php
@@ -137,7 +137,7 @@
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 @@
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 );
}
diff --git a/includes/api/ApiQueryAllLinks.php
b/includes/api/ApiQueryAllLinks.php
index 94707da..ac90605 100644
--- a/includes/api/ApiQueryAllLinks.php
+++ b/includes/api/ApiQueryAllLinks.php
@@ -117,7 +117,7 @@
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'
);
}
diff --git a/includes/api/ApiQueryBacklinks.php
b/includes/api/ApiQueryBacklinks.php
index 97b122a..fb502e4 100644
--- a/includes/api/ApiQueryBacklinks.php
+++ b/includes/api/ApiQueryBacklinks.php
@@ -296,7 +296,7 @@
// 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 @@
[ '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 @@
[ '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;
}
diff --git a/includes/api/ApiQueryBacklinksprop.php
b/includes/api/ApiQueryBacklinksprop.php
index 17b51da..7ad75a7 100644
--- a/includes/api/ApiQueryBacklinksprop.php
+++ b/includes/api/ApiQueryBacklinksprop.php
@@ -321,7 +321,7 @@
foreach ( $sortby as $field => $v ) {
$cont[] = $row->$field;
}
- $this->setContinueEnumParameter( 'continue', join( '|', $cont )
);
+ $this->setContinueEnumParameter( 'continue', implode( '|',
$cont ) );
}
public function getCacheMode( $params ) {
diff --git a/includes/api/ApiQueryFileRepoInfo.php
b/includes/api/ApiQueryFileRepoInfo.php
index 7848bc8..c491236 100644
--- a/includes/api/ApiQueryFileRepoInfo.php
+++ b/includes/api/ApiQueryFileRepoInfo.php
@@ -78,7 +78,7 @@
return [
'prop' => [
- ApiBase::PARAM_DFLT => join( '|', $props ),
+ ApiBase::PARAM_DFLT => implode( '|', $props ),
ApiBase::PARAM_ISMULTI => true,
ApiBase::PARAM_TYPE => $props,
],
diff --git a/includes/api/ApiResult.php b/includes/api/ApiResult.php
index a5f22c3..3436320 100644
--- a/includes/api/ApiResult.php
+++ b/includes/api/ApiResult.php
@@ -312,7 +312,7 @@
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 @@
$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];
diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php
index 0eecaa1..326f8ba 100644
--- a/includes/api/ApiUpload.php
+++ b/includes/api/ApiUpload.php
@@ -544,7 +544,7 @@
$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 {
diff --git a/includes/content/JsonContent.php b/includes/content/JsonContent.php
index b9215fc..40d9277 100644
--- a/includes/content/JsonContent.php
+++ b/includes/content/JsonContent.php
@@ -161,7 +161,7 @@
);
}
return Html::rawElement( 'table', [ 'class' => 'mw-json' ],
- Html::rawElement( 'tbody', [], join( '', $rows ) )
+ Html::rawElement( 'tbody', [], implode( '', $rows ) )
);
}
@@ -200,7 +200,7 @@
);
}
return Html::rawElement( 'table', [ 'class' => 'mw-json' ],
- Html::rawElement( 'tbody', [], join( "\n", $rows ) )
+ Html::rawElement( 'tbody', [], implode( "\n", $rows ) )
);
}
diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php
index 9b301a9..9e53653 100644
--- a/includes/db/DatabaseOracle.php
+++ b/includes/db/DatabaseOracle.php
@@ -618,7 +618,7 @@
$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"
diff --git a/includes/filerepo/ForeignAPIRepo.php
b/includes/filerepo/ForeignAPIRepo.php
index d29cd7d..cc9099c 100644
--- a/includes/filerepo/ForeignAPIRepo.php
+++ b/includes/filerepo/ForeignAPIRepo.php
@@ -537,7 +537,7 @@
* @since 1.23
*/
protected static function getIIProps() {
- return join( '|', self::$imageInfoProps );
+ return implode( '|', self::$imageInfoProps );
}
/**
diff --git a/includes/installer/MysqlUpdater.php
b/includes/installer/MysqlUpdater.php
index 57eaffe..154f7c3 100644
--- a/includes/installer/MysqlUpdater.php
+++ b/includes/installer/MysqlUpdater.php
@@ -516,7 +516,7 @@
$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" );
diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index d65e8be..d7ba266 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -4636,7 +4636,7 @@
$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 @@
$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 @@
$sections[0] = $sections[0] . $toc . "\n";
}
- $full .= join( '', $sections );
+ $full .= implode( '', $sections );
if ( $this->mForceTocPosition ) {
return str_replace( '<!--MWTOC-->', $toc, $full );
diff --git a/includes/search/SearchMssql.php b/includes/search/SearchMssql.php
index 598702d..5e8fb04 100644
--- a/includes/search/SearchMssql.php
+++ b/includes/search/SearchMssql.php
@@ -160,7 +160,7 @@
}
}
- $searchon = $this->db->addQuotes( join( ',', $q ) );
+ $searchon = $this->db->addQuotes( implode( ',', $q ) );
$field = $this->getIndexField( $fulltext );
return "$field, $searchon";
}
diff --git a/includes/session/BotPasswordSessionProvider.php
b/includes/session/BotPasswordSessionProvider.php
index 70c771d..bbdfdc3 100644
--- a/includes/session/BotPasswordSessionProvider.php
+++ b/includes/session/BotPasswordSessionProvider.php
@@ -120,7 +120,7 @@
if ( $missingKeys ) {
$this->logger->info( 'Session "{session}": Missing
metadata: {missing}', [
'session' => $info,
- 'missing' => join( ', ', $missingKeys ),
+ 'missing' => implode( ', ', $missingKeys ),
] );
return false;
}
diff --git a/includes/session/Session.php b/includes/session/Session.php
index 21db609..0fd8fa8 100644
--- a/includes/session/Session.php
+++ b/includes/session/Session.php
@@ -352,7 +352,7 @@
$new = true;
}
if ( is_array( $salt ) ) {
- $salt = join( '|', $salt );
+ $salt = implode( '|', $salt );
}
return new Token( $secret, (string)$salt, $new );
}
diff --git a/includes/session/SessionManager.php
b/includes/session/SessionManager.php
index 81f8243..2c1d7dc 100644
--- a/includes/session/SessionManager.php
+++ b/includes/session/SessionManager.php
@@ -287,7 +287,7 @@
// 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 @@
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;
diff --git a/includes/utils/MWRestrictions.php
b/includes/utils/MWRestrictions.php
index 521e345..617e8f5 100644
--- a/includes/utils/MWRestrictions.php
+++ b/includes/utils/MWRestrictions.php
@@ -69,13 +69,13 @@
$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 )
);
}
diff --git a/languages/classes/LanguageCu.php b/languages/classes/LanguageCu.php
index b36f080..89625c0 100644
--- a/languages/classes/LanguageCu.php
+++ b/languages/classes/LanguageCu.php
@@ -52,11 +52,11 @@
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': # винительный падеж
diff --git a/languages/classes/LanguageHy.php b/languages/classes/LanguageHy.php
index f6d5270..05b0ebe 100644
--- a/languages/classes/LanguageHy.php
+++ b/languages/classes/LanguageHy.php
@@ -52,12 +52,12 @@
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 .= 'ի';
}
diff --git a/languages/classes/LanguageUk.php b/languages/classes/LanguageUk.php
index 6cc23e3..72bde40 100644
--- a/languages/classes/LanguageUk.php
+++ b/languages/classes/LanguageUk.php
@@ -51,19 +51,19 @@
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;
}
diff --git a/maintenance/benchmarks/Benchmarker.php
b/maintenance/benchmarks/Benchmarker.php
index 8651a68..5fab082 100644
--- a/maintenance/benchmarks/Benchmarker.php
+++ b/maintenance/benchmarks/Benchmarker.php
@@ -87,7 +87,7 @@
$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,
diff --git a/maintenance/getConfiguration.php b/maintenance/getConfiguration.php
index 6bc9a6a..3c679e6 100644
--- a/maintenance/getConfiguration.php
+++ b/maintenance/getConfiguration.php
@@ -53,7 +53,7 @@
$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() {
diff --git a/tests/phpunit/includes/api/RandomImageGenerator.php
b/tests/phpunit/includes/api/RandomImageGenerator.php
index 62e175b..78cb7fb 100644
--- a/tests/phpunit/includes/api/RandomImageGenerator.php
+++ b/tests/phpunit/includes/api/RandomImageGenerator.php
@@ -230,7 +230,7 @@
$points[] = $point['x'] . ',' . $point['y'];
}
- return join( " ", $points );
+ return implode( " ", $points );
}
/**
@@ -425,7 +425,7 @@
$components[] = mt_rand( 0, 255 );
}
- return 'rgb(' . join( ', ', $components ) . ')';
+ return 'rgb(' . implode( ', ', $components ) . ')';
}
/**
diff --git a/tests/phpunit/includes/media/WebPTest.php
b/tests/phpunit/includes/media/WebPTest.php
index b50fe80..dfa92f1 100644
--- a/tests/phpunit/includes/media/WebPTest.php
+++ b/tests/phpunit/includes/media/WebPTest.php
@@ -137,5 +137,5 @@
}
/* 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) )
*/
diff --git a/tests/phpunit/includes/specialpage/SpecialPageFactoryTest.php
b/tests/phpunit/includes/specialpage/SpecialPageFactoryTest.php
index 998d2bb..534cf9b 100644
--- a/tests/phpunit/includes/specialpage/SpecialPageFactoryTest.php
+++ b/tests/phpunit/includes/specialpage/SpecialPageFactoryTest.php
@@ -171,7 +171,7 @@
$gotWarnings = count( $warnings );
if ( $gotWarnings !== $expectWarnings ) {
$this->fail( "Expected $expectWarnings warning(s), but
got $gotWarnings:\n" .
- join( "\n", $warnings )
+ implode( "\n", $warnings )
);
}
}
diff --git a/tests/phpunit/structure/ApiDocumentationTest.php
b/tests/phpunit/structure/ApiDocumentationTest.php
index b9cb6c1..542420a 100644
--- a/tests/phpunit/structure/ApiDocumentationTest.php
+++ b/tests/phpunit/structure/ApiDocumentationTest.php
@@ -153,7 +153,7 @@
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 ];
}
}
diff --git a/tests/qunit/data/generateJqueryMsgData.php
b/tests/qunit/data/generateJqueryMsgData.php
index 456787c..5a96dc3 100644
--- a/tests/qunit/data/generateJqueryMsgData.php
+++ b/tests/qunit/data/generateJqueryMsgData.php
@@ -110,7 +110,7 @@
$langKey = $languageCode . '_' . $key;
$messages[$langKey] = $template;
$tests[] = [
- 'name' => $languageCode . ' ' .
$key . ' ' . join( ',', $args ),
+ 'name' => $languageCode . ' ' .
$key . ' ' . implode( ',', $args ),
'key' => $langKey,
'args' => $args,
'result' => $result,
--
To view, visit https://gerrit.wikimedia.org/r/275770
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba50898c64c43f356d1caf8869f484e90d9ff651
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits