Skip to content
This repository
Browse code

replacing is_integer() with is_int()

  • Loading branch information...
commit aa87791432b153ab2fe958e3a3b1e9fe7ab52e5f 1 parent a38a616
Carl Sutton authored September 15, 2012
4  lib/Cake/Cache/Cache.php
@@ -366,7 +366,7 @@ public static function increment($key, $offset = 1, $config = 'default') {
366 366
 		}
367 367
 		$key = self::$_engines[$config]->key($key);
368 368
 
369  
-		if (!$key || !is_integer($offset) || $offset < 0) {
  369
+		if (!$key || !is_int($offset) || $offset < 0) {
370 370
 			return false;
371 371
 		}
372 372
 		$success = self::$_engines[$config]->increment($settings['prefix'] . $key, $offset);
@@ -394,7 +394,7 @@ public static function decrement($key, $offset = 1, $config = 'default') {
394 394
 		}
395 395
 		$key = self::$_engines[$config]->key($key);
396 396
 
397  
-		if (!$key || !is_integer($offset) || $offset < 0) {
  397
+		if (!$key || !is_int($offset) || $offset < 0) {
398 398
 			return false;
399 399
 		}
400 400
 		$success = self::$_engines[$config]->decrement($settings['prefix'] . $key, $offset);
2  lib/Cake/Controller/Component/CookieComponent.php
@@ -398,7 +398,7 @@ protected function _expire($expires = null) {
398 398
 			return $this->_expires = 0;
399 399
 		}
400 400
 
401  
-		if (is_integer($expires) || is_numeric($expires)) {
  401
+		if (is_int($expires) || is_numeric($expires)) {
402 402
 			return $this->_expires = $now + intval($expires);
403 403
 		}
404 404
 		return $this->_expires = strtotime($expires, $now);
4  lib/Cake/Network/CakeResponse.php
@@ -746,7 +746,7 @@ public function disableCache() {
746 746
  * @return void
747 747
  */
748 748
 	public function cache($since, $time = '+1 day') {
749  
-		if (!is_integer($time)) {
  749
+		if (!is_int($time)) {
750 750
 			$time = strtotime($time);
751 751
 		}
752 752
 		$this->header(array(
@@ -1008,7 +1008,7 @@ public function etag($tag = null, $weak = false) {
1008 1008
 	protected function _getUTCDate($time = null) {
1009 1009
 		if ($time instanceof DateTime) {
1010 1010
 			$result = clone $time;
1011  
-		} elseif (is_integer($time)) {
  1011
+		} elseif (is_int($time)) {
1012 1012
 			$result = new DateTime(date('Y-m-d H:i:s', $time));
1013 1013
 		} else {
1014 1014
 			$result = new DateTime($time);
2  lib/Cake/Routing/Route/CakeRoute.php
@@ -219,7 +219,7 @@ public function parse($url) {
219 219
 			if (isset($route[$key])) {
220 220
 				continue;
221 221
 			}
222  
-			if (is_integer($key)) {
  222
+			if (is_int($key)) {
223 223
 				$route['pass'][] = $value;
224 224
 				continue;
225 225
 			}
4  lib/Cake/Utility/CakeTime.php
@@ -310,7 +310,7 @@ public static function fromString($dateString, $timezone = null) {
310 310
 			return false;
311 311
 		}
312 312
 
313  
-		if (is_integer($dateString) || is_numeric($dateString)) {
  313
+		if (is_int($dateString) || is_numeric($dateString)) {
314 314
 			$date = intval($dateString);
315 315
 		} elseif (is_object($dateString) && $dateString instanceof DateTime) {
316 316
 			$clone = clone $dateString;
@@ -589,7 +589,7 @@ public static function toServer($dateString, $timezone = null, $format = 'Y-m-d
589 589
 
590 590
 		if ($dateString instanceof DateTime) {
591 591
 			$date = $dateString;
592  
-		} elseif (is_integer($dateString) || is_numeric($dateString)) {
  592
+		} elseif (is_int($dateString) || is_numeric($dateString)) {
593 593
 			$dateString = (int)$dateString;
594 594
 
595 595
 			$date = new DateTime('@' . $dateString);
2  lib/Cake/Utility/Xml.php
@@ -174,7 +174,7 @@ public static function fromArray($input, $options = array()) {
174 174
 			throw new XmlException(__d('cake_dev', 'Invalid input.'));
175 175
 		}
176 176
 		$key = key($input);
177  
-		if (is_integer($key)) {
  177
+		if (is_int($key)) {
178 178
 			throw new XmlException(__d('cake_dev', 'The key of input must be alphanumeric'));
179 179
 		}
180 180
 

0 notes on commit aa87791

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