mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Merge pull request #848 from dogmatic69/removing-alias-function-calls
Removing alias function calls
This commit is contained in:
commit
7f76f70287
21 changed files with 40 additions and 40 deletions
|
@ -366,7 +366,7 @@ class Cache {
|
|||
}
|
||||
$key = self::$_engines[$config]->key($key);
|
||||
|
||||
if (!$key || !is_integer($offset) || $offset < 0) {
|
||||
if (!$key || !is_int($offset) || $offset < 0) {
|
||||
return false;
|
||||
}
|
||||
$success = self::$_engines[$config]->increment($settings['prefix'] . $key, $offset);
|
||||
|
@ -394,7 +394,7 @@ class Cache {
|
|||
}
|
||||
$key = self::$_engines[$config]->key($key);
|
||||
|
||||
if (!$key || !is_integer($offset) || $offset < 0) {
|
||||
if (!$key || !is_int($offset) || $offset < 0) {
|
||||
return false;
|
||||
}
|
||||
$success = self::$_engines[$config]->decrement($settings['prefix'] . $key, $offset);
|
||||
|
|
|
@ -180,7 +180,7 @@ class IniReader implements ConfigReaderInterface {
|
|||
}
|
||||
}
|
||||
}
|
||||
$contents = join("\n", $result);
|
||||
$contents = implode("\n", $result);
|
||||
|
||||
if (substr($filename, -4) !== '.ini') {
|
||||
$filename .= '.ini';
|
||||
|
|
|
@ -86,7 +86,7 @@ if (!empty($failed)) {
|
|||
}
|
||||
|
||||
if (Configure::read('debug') < 1) {
|
||||
die(__d('cake_dev', 'Debug setting does not allow access to this url.'));
|
||||
exit(__d('cake_dev', 'Debug setting does not allow access to this url.'));
|
||||
}
|
||||
|
||||
require_once CAKE . 'TestSuite' . DS . 'CakeTestSuiteDispatcher.php';
|
||||
|
|
|
@ -398,7 +398,7 @@ class CookieComponent extends Component {
|
|||
return $this->_expires = 0;
|
||||
}
|
||||
|
||||
if (is_integer($expires) || is_numeric($expires)) {
|
||||
if (is_int($expires) || is_numeric($expires)) {
|
||||
return $this->_expires = $now + intval($expires);
|
||||
}
|
||||
return $this->_expires = strtotime($expires, $now);
|
||||
|
|
|
@ -592,19 +592,19 @@ class I18n {
|
|||
$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])));
|
||||
|
|
|
@ -418,26 +418,26 @@ class CakeSchema extends Object {
|
|||
}
|
||||
$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;
|
||||
|
|
|
@ -459,7 +459,7 @@ class Sqlite extends DboSource {
|
|||
$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 @@ class Sqlite extends DboSource {
|
|||
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:
|
||||
|
|
|
@ -1766,7 +1766,7 @@ class DboSource extends DataSource {
|
|||
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} = '';
|
||||
}
|
||||
|
|
|
@ -746,7 +746,7 @@ class CakeResponse {
|
|||
* @return void
|
||||
*/
|
||||
public function cache($since, $time = '+1 day') {
|
||||
if (!is_integer($time)) {
|
||||
if (!is_int($time)) {
|
||||
$time = strtotime($time);
|
||||
}
|
||||
$this->header(array(
|
||||
|
@ -1008,7 +1008,7 @@ class CakeResponse {
|
|||
protected function _getUTCDate($time = null) {
|
||||
if ($time instanceof DateTime) {
|
||||
$result = clone $time;
|
||||
} elseif (is_integer($time)) {
|
||||
} elseif (is_int($time)) {
|
||||
$result = new DateTime(date('Y-m-d H:i:s', $time));
|
||||
} else {
|
||||
$result = new DateTime($time);
|
||||
|
|
|
@ -219,7 +219,7 @@ class CakeRoute {
|
|||
if (isset($route[$key])) {
|
||||
continue;
|
||||
}
|
||||
if (is_integer($key)) {
|
||||
if (is_int($key)) {
|
||||
$route['pass'][] = $value;
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -3270,7 +3270,7 @@ class MysqlTest extends CakeTestCase {
|
|||
);
|
||||
|
||||
$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(
|
||||
|
|
|
@ -61,7 +61,7 @@ class CakeTestSuiteTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testAddTestDirectoryRecursiveWithHidden() {
|
||||
$this->skipIf(!is_writeable(TMP), 'Cant addTestDirectoryRecursiveWithHidden unless the tmp folder is writable.');
|
||||
$this->skipIf(!is_writable(TMP), 'Cant addTestDirectoryRecursiveWithHidden unless the tmp folder is writable.');
|
||||
|
||||
$Folder = new Folder(TMP . 'MyTestFolder', true, 0777);
|
||||
mkdir($Folder->path . DS . '.svn', 0777, true);
|
||||
|
@ -85,7 +85,7 @@ class CakeTestSuiteTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testAddTestDirectoryRecursiveWithNonPhp() {
|
||||
$this->skipIf(!is_writeable(TMP), 'Cant addTestDirectoryRecursiveWithNonPhp unless the tmp folder is writable.');
|
||||
$this->skipIf(!is_writable(TMP), 'Cant addTestDirectoryRecursiveWithNonPhp unless the tmp folder is writable.');
|
||||
|
||||
$Folder = new Folder(TMP . 'MyTestFolder', true, 0777);
|
||||
touch($Folder->path . DS . 'BackupTest.php~');
|
||||
|
|
|
@ -374,7 +374,7 @@ class FolderTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testFolderReadWithHiddenFiles() {
|
||||
$this->skipIf(!is_writeable(TMP), 'Cant test Folder::read with hidden files unless the tmp folder is writable.');
|
||||
$this->skipIf(!is_writable(TMP), 'Cant test Folder::read with hidden files unless the tmp folder is writable.');
|
||||
|
||||
$Folder = new Folder(TMP . 'folder_tree_hidden', true, 0777);
|
||||
mkdir($Folder->path . DS . '.svn');
|
||||
|
@ -457,7 +457,7 @@ class FolderTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testFolderTreeWithHiddenFiles() {
|
||||
$this->skipIf(!is_writeable(TMP), 'Can\'t test Folder::tree with hidden files unless the tmp folder is writable.');
|
||||
$this->skipIf(!is_writable(TMP), 'Can\'t test Folder::tree with hidden files unless the tmp folder is writable.');
|
||||
|
||||
$Folder = new Folder(TMP . 'folder_tree_hidden', true, 0777);
|
||||
mkdir($Folder->path . DS . '.svn', 0777, true);
|
||||
|
|
|
@ -310,7 +310,7 @@ class CakeTime {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (is_integer($dateString) || is_numeric($dateString)) {
|
||||
if (is_int($dateString) || is_numeric($dateString)) {
|
||||
$date = intval($dateString);
|
||||
} elseif (is_object($dateString) && $dateString instanceof DateTime) {
|
||||
$clone = clone $dateString;
|
||||
|
@ -589,7 +589,7 @@ class CakeTime {
|
|||
|
||||
if ($dateString instanceof DateTime) {
|
||||
$date = $dateString;
|
||||
} elseif (is_integer($dateString) || is_numeric($dateString)) {
|
||||
} elseif (is_int($dateString) || is_numeric($dateString)) {
|
||||
$dateString = (int)$dateString;
|
||||
|
||||
$date = new DateTime('@' . $dateString);
|
||||
|
|
|
@ -318,7 +318,7 @@ class Debugger {
|
|||
foreach ($next['args'] as $arg) {
|
||||
$args[] = Debugger::exportVar($arg);
|
||||
}
|
||||
$reference .= join(', ', $args);
|
||||
$reference .= implode(', ', $args);
|
||||
}
|
||||
$reference .= ')';
|
||||
}
|
||||
|
@ -779,11 +779,11 @@ class Debugger {
|
|||
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'));
|
||||
|
|
|
@ -406,8 +406,8 @@ class Inflector {
|
|||
}
|
||||
|
||||
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)) {
|
||||
|
|
|
@ -174,7 +174,7 @@ class Xml {
|
|||
throw new XmlException(__d('cake_dev', 'Invalid input.'));
|
||||
}
|
||||
$key = key($input);
|
||||
if (is_integer($key)) {
|
||||
if (is_int($key)) {
|
||||
throw new XmlException(__d('cake_dev', 'The key of input must be alphanumeric'));
|
||||
}
|
||||
|
||||
|
|
|
@ -607,7 +607,7 @@ class Helper extends Object {
|
|||
|
||||
$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;
|
||||
|
|
|
@ -274,7 +274,7 @@ class FormHelper extends AppHelper {
|
|||
if (empty($errors)) {
|
||||
return false;
|
||||
}
|
||||
$errors = Hash::get($errors, join('.', $entity));
|
||||
$errors = Hash::get($errors, implode('.', $entity));
|
||||
return $errors === null ? false : $errors;
|
||||
}
|
||||
|
||||
|
|
|
@ -637,7 +637,7 @@ class HtmlHelper extends AppHelper {
|
|||
$out[] = $key . ':' . $value . ';';
|
||||
}
|
||||
if ($oneline) {
|
||||
return join(' ', $out);
|
||||
return implode(' ', $out);
|
||||
}
|
||||
return implode("\n", $out);
|
||||
}
|
||||
|
@ -669,7 +669,7 @@ class HtmlHelper extends AppHelper {
|
|||
$out[] = $crumb[0];
|
||||
}
|
||||
}
|
||||
return join($separator, $out);
|
||||
return implode($separator, $out);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
@ -805,7 +805,7 @@ class HtmlHelper extends AppHelper {
|
|||
$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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -494,7 +494,7 @@ abstract class JsBaseEngineHelper extends AppHelper {
|
|||
$out[] = $key . ':' . $value;
|
||||
}
|
||||
sort($out);
|
||||
return join(', ', $out);
|
||||
return implode(', ', $out);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue