Skip to content
This repository
Browse code

converting if ($foo != "") to if ($foo)

  • Loading branch information...
commit 36314e6d37cf954e207d183f15705aecd85e55fe 1 parent 8dc4de5
Carl Sutton authored September 21, 2012
2  lib/Cake/Model/Datasource/CakeSession.php
@@ -663,7 +663,7 @@ protected static function _checkValid() {
663 663
  */
664 664
 	public static function renew() {
665 665
 		if (session_id()) {
666  
-			if (session_id() != '' || isset($_COOKIE[session_name()])) {
  666
+			if (session_id() || isset($_COOKIE[session_name()])) {
667 667
 				setcookie(Configure::read('Session.cookie'), '', time() - 42000, self::$path);
668 668
 			}
669 669
 			session_regenerate_id(true);
2  lib/Cake/View/Helper.php
@@ -749,7 +749,7 @@ protected function _initInputField($field, $options = array()) {
749 749
  * @return array Array of options with $key set.
750 750
  */
751 751
 	public function addClass($options = array(), $class = null, $key = 'class') {
752  
-		if (isset($options[$key]) && trim($options[$key]) != '') {
  752
+		if (isset($options[$key]) && trim($options[$key])) {
753 753
 			$options[$key] .= ' ' . $class;
754 754
 		} else {
755 755
 			$options[$key] = $class;
2  lib/Cake/View/Helper/CacheHelper.php
@@ -148,7 +148,7 @@ public function cache($file, $out) {
148 148
 			$cacheTime = $cacheAction;
149 149
 		}
150 150
 
151  
-		if ($cacheTime != '' && $cacheTime > 0) {
  151
+		if ($cacheTime && $cacheTime > 0) {
152 152
 			$cached = $this->_parseOutput($out);
153 153
 			try {
154 154
 				$this->_writeFile($cached, $cacheTime, $useCallbacks);

0 notes on commit 36314e6

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