Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

changing join() to implode() for consistency

  • Loading branch information...
commit a38a616cba8786f851cac31d973131db046295c4 1 parent ccd3378
@dogmatic69 dogmatic69 authored
View
2  lib/Cake/Configure/IniReader.php
@@ -180,7 +180,7 @@ public function dump($filename, $data) {
}
}
}
- $contents = join("\n", $result);
+ $contents = implode("\n", $result);
if (substr($filename, -4) !== '.ini') {
$filename .= '.ini';
View
8 lib/Cake/I18n/I18n.php
@@ -592,19 +592,19 @@ protected function _parseLiteralValue($string) {
$string = $string[1];
if (substr($string, 0, 2) === $this->_escape . 'x') {
$delimiter = $this->_escape . 'x';
- return join('', array_map('chr', array_map('hexdec',array_filter(explode($delimiter, $string)))));
+ return implode('', array_map('chr', array_map('hexdec',array_filter(explode($delimiter, $string)))));
}
if (substr($string, 0, 2) === $this->_escape . 'd') {
$delimiter = $this->_escape . 'd';
- return join('', array_map('chr', array_filter(explode($delimiter, $string))));
+ return implode('', array_map('chr', array_filter(explode($delimiter, $string))));
}
if ($string[0] === $this->_escape && isset($string[1]) && is_numeric($string[1])) {
$delimiter = $this->_escape;
- return join('', array_map('chr', array_filter(explode($delimiter, $string))));
+ return implode('', array_map('chr', array_filter(explode($delimiter, $string))));
}
if (substr($string, 0, 3) === 'U00') {
$delimiter = 'U00';
- return join('', array_map('chr', array_map('hexdec', array_filter(explode($delimiter, $string)))));
+ return implode('', array_map('chr', array_map('hexdec', array_filter(explode($delimiter, $string)))));
}
if (preg_match('/U([0-9a-fA-F]{4})/', $string, $match)) {
return Multibyte::ascii(array(hexdec($match[1])));
View
10 lib/Cake/Model/CakeSchema.php
@@ -418,26 +418,26 @@ public function generateTable($table, $fields) {
}
$col = "\t\t'{$field}' => array('type' => '" . $value['type'] . "', ";
unset($value['type']);
- $col .= join(', ', $this->_values($value));
+ $col .= implode(', ', $this->_values($value));
} elseif ($field == 'indexes') {
$col = "\t\t'indexes' => array(\n\t\t\t";
$props = array();
foreach ((array)$value as $key => $index) {
- $props[] = "'{$key}' => array(" . join(', ', $this->_values($index)) . ")";
+ $props[] = "'{$key}' => array(" . implode(', ', $this->_values($index)) . ")";
}
- $col .= join(",\n\t\t\t", $props) . "\n\t\t";
+ $col .= implode(",\n\t\t\t", $props) . "\n\t\t";
} elseif ($field == 'tableParameters') {
$col = "\t\t'tableParameters' => array(";
$props = array();
foreach ((array)$value as $key => $param) {
$props[] = "'{$key}' => '$param'";
}
- $col .= join(', ', $props);
+ $col .= implode(', ', $props);
}
$col .= ")";
$cols[] = $col;
}
- $out .= join(",\n", $cols);
+ $out .= implode(",\n", $cols);
}
$out .= "\n\t);\n";
return $out;
View
6 lib/Cake/Model/Datasource/Database/Sqlite.php
@@ -459,7 +459,7 @@ public function buildIndex($indexes, $table = null) {
$out .= 'UNIQUE ';
}
if (is_array($value['column'])) {
- $value['column'] = join(', ', array_map(array(&$this, 'name'), $value['column']));
+ $value['column'] = implode(', ', array_map(array(&$this, 'name'), $value['column']));
} else {
$value['column'] = $this->name($value['column']);
}
@@ -524,10 +524,10 @@ public function renderStatement($type, $data) {
case 'schema':
extract($data);
if (is_array($columns)) {
- $columns = "\t" . join(",\n\t", array_filter($columns));
+ $columns = "\t" . implode(",\n\t", array_filter($columns));
}
if (is_array($indexes)) {
- $indexes = "\t" . join("\n\t", array_filter($indexes));
+ $indexes = "\t" . implode("\n\t", array_filter($indexes));
}
return "CREATE TABLE {$table} (\n{$columns});\n{$indexes}";
default:
View
2  lib/Cake/Model/Datasource/DboSource.php
@@ -1766,7 +1766,7 @@ public function renderStatement($type, $data) {
case 'schema':
foreach (array('columns', 'indexes', 'tableParameters') as $var) {
if (is_array(${$var})) {
- ${$var} = "\t" . join(",\n\t", array_filter(${$var}));
+ ${$var} = "\t" . implode(",\n\t", array_filter(${$var}));
} else {
${$var} = '';
}
View
2  lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
@@ -3270,7 +3270,7 @@ public function testVirtualFieldsFetch() {
);
$conditions = array('comment_count >' => 2);
- $query = 'SELECT ' . join(',', $this->Dbo->fields($Article, null, array('id', 'comment_count'))) .
+ $query = 'SELECT ' . implode(',', $this->Dbo->fields($Article, null, array('id', 'comment_count'))) .
' FROM ' . $this->Dbo->fullTableName($Article) . ' Article ' . $this->Dbo->conditions($conditions, true, true, $Article);
$result = $this->Dbo->fetchAll($query);
$expected = array(array(
View
6 lib/Cake/Utility/Debugger.php
@@ -318,7 +318,7 @@ public static function trace($options = array()) {
foreach ($next['args'] as $arg) {
$args[] = Debugger::exportVar($arg);
}
- $reference .= join(', ', $args);
+ $reference .= implode(', ', $args);
}
$reference .= ')';
}
@@ -779,11 +779,11 @@ public function outputError($data) {
continue;
}
if (is_array($value)) {
- $value = join("\n", $value);
+ $value = implode("\n", $value);
}
$info .= String::insert($tpl[$key], array($key => $value) + $data, $insertOpts);
}
- $links = join(' ', $links);
+ $links = implode(' ', $links);
if (isset($tpl['callback']) && is_callable($tpl['callback'])) {
return call_user_func($tpl['callback'], $data, compact('links', 'info'));
View
4 lib/Cake/Utility/Inflector.php
@@ -406,8 +406,8 @@ public static function singularize($word) {
}
if (!isset(self::$_singular['cacheUninflected']) || !isset(self::$_singular['cacheIrregular'])) {
- self::$_singular['cacheUninflected'] = '(?:' . join('|', self::$_singular['merged']['uninflected']) . ')';
- self::$_singular['cacheIrregular'] = '(?:' . join('|', array_keys(self::$_singular['merged']['irregular'])) . ')';
+ self::$_singular['cacheUninflected'] = '(?:' . implode('|', self::$_singular['merged']['uninflected']) . ')';
+ self::$_singular['cacheIrregular'] = '(?:' . implode('|', array_keys(self::$_singular['merged']['irregular'])) . ')';
}
if (preg_match('/(.*)\\b(' . self::$_singular['cacheIrregular'] . ')$/i', $word, $regs)) {
View
2  lib/Cake/View/Helper.php
@@ -607,7 +607,7 @@ public function domId($options = null, $id = 'id') {
$entity = $this->entity();
$model = array_shift($entity);
- $dom = $model . join('', array_map(array('Inflector', 'camelize'), $entity));
+ $dom = $model . implode('', array_map(array('Inflector', 'camelize'), $entity));
if (is_array($options) && !array_key_exists($id, $options)) {
$options[$id] = $dom;
View
2  lib/Cake/View/Helper/FormHelper.php
@@ -274,7 +274,7 @@ public function tagIsInvalid() {
if (empty($errors)) {
return false;
}
- $errors = Hash::get($errors, join('.', $entity));
+ $errors = Hash::get($errors, implode('.', $entity));
return $errors === null ? false : $errors;
}
View
6 lib/Cake/View/Helper/HtmlHelper.php
@@ -637,7 +637,7 @@ public function style($data, $oneline = true) {
$out[] = $key . ':' . $value . ';';
}
if ($oneline) {
- return join(' ', $out);
+ return implode(' ', $out);
}
return implode("\n", $out);
}
@@ -669,7 +669,7 @@ public function getCrumbs($separator = '»', $startText = false) {
$out[] = $crumb[0];
}
}
- return join($separator, $out);
+ return implode($separator, $out);
} else {
return null;
}
@@ -805,7 +805,7 @@ public function tableHeaders($names, $trOptions = null, $thOptions = null) {
$out[] = sprintf($this->_tags['tableheader'], $this->_parseAttributes(current($arg)), key($arg));
}
}
- return sprintf($this->_tags['tablerow'], $this->_parseAttributes($trOptions), join(' ', $out));
+ return sprintf($this->_tags['tablerow'], $this->_parseAttributes($trOptions), implode(' ', $out));
}
/**
View
2  lib/Cake/View/Helper/JsBaseEngineHelper.php
@@ -494,7 +494,7 @@ protected function _parseOptions($options, $safeKeys = array()) {
$out[] = $key . ':' . $value;
}
sort($out);
- return join(', ', $out);
+ return implode(', ', $out);
}
/**

0 comments on commit a38a616

Please sign in to comment.
Something went wrong with that request. Please try again.