Skip to content

Commit 01edaf6

Browse files
authored
Replaced join() calls with implode() (#2389)
1 parent c3972f3 commit 01edaf6

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

lib/Net/IDNA2.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2439,7 +2439,7 @@ public function decode($input, $one_time_encoding = false)
24392439
$conv = $this->_decode($v);
24402440
if ($conv) $arr[$k] = $conv;
24412441
}
2442-
$return = $email_pref . '@' . join('.', $arr);
2442+
$return = $email_pref . '@' . implode('.', $arr);
24432443
} elseif (preg_match('![:\./]!', $input)) { // Or a complete domain name (with or without paths / parameters)
24442444
// No no in strict mode
24452445
if ($this->_strict_mode) {
@@ -2453,7 +2453,7 @@ public function decode($input, $one_time_encoding = false)
24532453
$conv = $this->_decode($v);
24542454
if ($conv) $arr[$k] = $conv;
24552455
}
2456-
$parsed['host'] = join('.', $arr);
2456+
$parsed['host'] = implode('.', $arr);
24572457
if (isset($parsed['scheme'])) {
24582458
$parsed['scheme'] .= (strtolower($parsed['scheme']) == 'mailto') ? ':' : '://';
24592459
}
@@ -2464,7 +2464,7 @@ public function decode($input, $one_time_encoding = false)
24642464
$conv = $this->_decode($v);
24652465
if ($conv) $arr[$k] = $conv;
24662466
}
2467-
$return = join('.', $arr);
2467+
$return = implode('.', $arr);
24682468
}
24692469
} else { // Otherwise we consider it being a pure domain name string
24702470
$return = $this->_decode($input);

lib/Varien/Convert/Parser/Csv.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function unparse()
139139
foreach ($fields as $f) {
140140
$line[] = $fEnc.str_replace(array('"', '\\'), array($fEsc.'"', $fEsc.'\\'), $f).$fEnc;
141141
}
142-
$lines[] = join($fDel, $line);
142+
$lines[] = implode($fDel, $line);
143143
}
144144
foreach ($data as $i=>$row) {
145145
$line = array();
@@ -154,9 +154,9 @@ public function unparse()
154154

155155
$line[] = $fEnc.$v.$fEnc;
156156
}
157-
$lines[] = join($fDel, $line);
157+
$lines[] = implode($fDel, $line);
158158
}
159-
$result = join($lDel, $lines);
159+
$result = implode($lDel, $lines);
160160
$this->setData($result);
161161

162162
return $this;

lib/Varien/Convert/Parser/Xml/Excel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,6 @@ public function getRowXml(array $row)
220220
}
221221
$xmlData[] = '</Row>';
222222

223-
return join('', $xmlData);
223+
return implode('', $xmlData);
224224
}
225225
}

lib/Varien/Data/Collection/Db.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ public function addFieldToFilter($field, $condition = null)
394394
);
395395
}
396396

397-
$resultCondition = '(' . join(') ' . Zend_Db_Select::SQL_OR . ' (', $conditions) . ')';
397+
$resultCondition = '(' . implode(') ' . Zend_Db_Select::SQL_OR . ' (', $conditions) . ')';
398398
}
399399

400400
$this->_select->where($resultCondition);

lib/Varien/Db/Adapter/Mysqli.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public function dropColumn($tableName, $columnName)
262262
}
263263
}
264264

265-
return $this->raw_query('ALTER TABLE `'.$tableName.'` ' . join(', ', $alterDrop));
265+
return $this->raw_query('ALTER TABLE `'.$tableName.'` ' . implode(', ', $alterDrop));
266266
}
267267

268268
/**

lib/Varien/Db/Adapter/Pdo/Mysql.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3535,7 +3535,7 @@ public function insertFromSelect(Varien_Db_Select $select, $table, array $fields
35353535
$query = sprintf('%s INTO %s', $query, $this->quoteIdentifier($table));
35363536
if ($fields) {
35373537
$columns = array_map(array($this, 'quoteIdentifier'), $fields);
3538-
$query = sprintf('%s (%s)', $query, join(', ', $columns));
3538+
$query = sprintf('%s (%s)', $query, implode(', ', $columns));
35393539
}
35403540

35413541
$query = sprintf('%s %s', $query, $select->assemble());
@@ -3572,7 +3572,7 @@ public function insertFromSelect(Varien_Db_Select $select, $table, array $fields
35723572
}
35733573
}
35743574
if ($update) {
3575-
$query = sprintf('%s ON DUPLICATE KEY UPDATE %s', $query, join(', ', $update));
3575+
$query = sprintf('%s ON DUPLICATE KEY UPDATE %s', $query, implode(', ', $update));
35763576
}
35773577
}
35783578

lib/Varien/Debug.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ public static function trace(array $trace, $return = false, $html = true, $withA
111111
$className,
112112
isset($data['type']) ? $data['type'] : '->',
113113
$data['function'],
114-
join(', ', $args)
114+
implode(', ', $args)
115115
);
116116
} else if (isset($data['function'])) {
117-
$methodName = sprintf('%s(%s)', $data['function'], join(', ', $args));
117+
$methodName = sprintf('%s(%s)', $data['function'], implode(', ', $args));
118118
}
119119

120120
if (isset($data['file'])) {
@@ -175,9 +175,9 @@ protected static function _formatCalledArgument($arg)
175175
foreach ($args as $k => $v) {
176176
$arr[] = self::_formatCalledArgument($k) . ' => ' . $v;
177177
}
178-
$out .= 'array(' . join(', ', $arr) . ')';
178+
$out .= 'array(' . implode(', ', $arr) . ')';
179179
} else {
180-
$out .= 'array(' . join(', ', $args) . ')';
180+
$out .= 'array(' . implode(', ', $args) . ')';
181181
}
182182
} else if (is_null($arg)) {
183183
$out .= 'NULL';

0 commit comments

Comments
 (0)