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);
|
||||
|
||||
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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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'));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue