mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
replacing is_integer() with is_int()
This commit is contained in:
parent
a38a616cba
commit
aa87791432
6 changed files with 9 additions and 9 deletions
|
@ -366,7 +366,7 @@ class Cache {
|
||||||
}
|
}
|
||||||
$key = self::$_engines[$config]->key($key);
|
$key = self::$_engines[$config]->key($key);
|
||||||
|
|
||||||
if (!$key || !is_integer($offset) || $offset < 0) {
|
if (!$key || !is_int($offset) || $offset < 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$success = self::$_engines[$config]->increment($settings['prefix'] . $key, $offset);
|
$success = self::$_engines[$config]->increment($settings['prefix'] . $key, $offset);
|
||||||
|
@ -394,7 +394,7 @@ class Cache {
|
||||||
}
|
}
|
||||||
$key = self::$_engines[$config]->key($key);
|
$key = self::$_engines[$config]->key($key);
|
||||||
|
|
||||||
if (!$key || !is_integer($offset) || $offset < 0) {
|
if (!$key || !is_int($offset) || $offset < 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$success = self::$_engines[$config]->decrement($settings['prefix'] . $key, $offset);
|
$success = self::$_engines[$config]->decrement($settings['prefix'] . $key, $offset);
|
||||||
|
|
|
@ -398,7 +398,7 @@ class CookieComponent extends Component {
|
||||||
return $this->_expires = 0;
|
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 = $now + intval($expires);
|
||||||
}
|
}
|
||||||
return $this->_expires = strtotime($expires, $now);
|
return $this->_expires = strtotime($expires, $now);
|
||||||
|
|
|
@ -746,7 +746,7 @@ class CakeResponse {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function cache($since, $time = '+1 day') {
|
public function cache($since, $time = '+1 day') {
|
||||||
if (!is_integer($time)) {
|
if (!is_int($time)) {
|
||||||
$time = strtotime($time);
|
$time = strtotime($time);
|
||||||
}
|
}
|
||||||
$this->header(array(
|
$this->header(array(
|
||||||
|
@ -1008,7 +1008,7 @@ class CakeResponse {
|
||||||
protected function _getUTCDate($time = null) {
|
protected function _getUTCDate($time = null) {
|
||||||
if ($time instanceof DateTime) {
|
if ($time instanceof DateTime) {
|
||||||
$result = clone $time;
|
$result = clone $time;
|
||||||
} elseif (is_integer($time)) {
|
} elseif (is_int($time)) {
|
||||||
$result = new DateTime(date('Y-m-d H:i:s', $time));
|
$result = new DateTime(date('Y-m-d H:i:s', $time));
|
||||||
} else {
|
} else {
|
||||||
$result = new DateTime($time);
|
$result = new DateTime($time);
|
||||||
|
|
|
@ -219,7 +219,7 @@ class CakeRoute {
|
||||||
if (isset($route[$key])) {
|
if (isset($route[$key])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (is_integer($key)) {
|
if (is_int($key)) {
|
||||||
$route['pass'][] = $value;
|
$route['pass'][] = $value;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -310,7 +310,7 @@ class CakeTime {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_integer($dateString) || is_numeric($dateString)) {
|
if (is_int($dateString) || is_numeric($dateString)) {
|
||||||
$date = intval($dateString);
|
$date = intval($dateString);
|
||||||
} elseif (is_object($dateString) && $dateString instanceof DateTime) {
|
} elseif (is_object($dateString) && $dateString instanceof DateTime) {
|
||||||
$clone = clone $dateString;
|
$clone = clone $dateString;
|
||||||
|
@ -589,7 +589,7 @@ class CakeTime {
|
||||||
|
|
||||||
if ($dateString instanceof DateTime) {
|
if ($dateString instanceof DateTime) {
|
||||||
$date = $dateString;
|
$date = $dateString;
|
||||||
} elseif (is_integer($dateString) || is_numeric($dateString)) {
|
} elseif (is_int($dateString) || is_numeric($dateString)) {
|
||||||
$dateString = (int)$dateString;
|
$dateString = (int)$dateString;
|
||||||
|
|
||||||
$date = new DateTime('@' . $dateString);
|
$date = new DateTime('@' . $dateString);
|
||||||
|
|
|
@ -174,7 +174,7 @@ class Xml {
|
||||||
throw new XmlException(__d('cake_dev', 'Invalid input.'));
|
throw new XmlException(__d('cake_dev', 'Invalid input.'));
|
||||||
}
|
}
|
||||||
$key = key($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'));
|
throw new XmlException(__d('cake_dev', 'The key of input must be alphanumeric'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue