Skip to content
This repository
Browse code

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

  • Loading branch information...
commit 8dc4de5de8454a55b961def4efc5c47ffa6af0f6 1 parent b1f26b5
Carl Sutton authored September 21, 2012
2  lib/Cake/Controller/Component/EmailComponent.php
@@ -316,7 +316,7 @@ public function send($content = null, $template = null, $layout = null) {
316 316
 		foreach ($this->headers as $key => $value) {
317 317
 			$headers['X-' . $key] = $value;
318 318
 		}
319  
-		if ($this->date != false) {
  319
+		if ($this->date) {
320 320
 			$headers['Date'] = $this->date;
321 321
 		}
322 322
 		$lib->setHeaders($headers);
2  lib/Cake/Controller/Scaffold.php
@@ -146,7 +146,7 @@ public function __construct(Controller $controller, CakeRequest $request) {
146 146
 			$this->controller->viewClass = 'Scaffold';
147 147
 		}
148 148
 		$this->_validSession = (
149  
-			isset($this->controller->Session) && $this->controller->Session->valid() != false
  149
+			isset($this->controller->Session) && $this->controller->Session->valid()
150 150
 		);
151 151
 		$this->_scaffold($request);
152 152
 	}
2  lib/Cake/Model/Model.php
@@ -2561,7 +2561,7 @@ public function exists($id = null) {
2561 2561
  * @return boolean True if such a record exists
2562 2562
  */
2563 2563
 	public function hasAny($conditions = null) {
2564  
-		return ($this->find('count', array('conditions' => $conditions, 'recursive' => -1)) != false);
  2564
+		return (bool)$this->find('count', array('conditions' => $conditions, 'recursive' => -1));
2565 2565
 	}
2566 2566
 
2567 2567
 /**
2  lib/Cake/View/Helper/CacheHelper.php
@@ -59,7 +59,7 @@ class CacheHelper extends AppHelper {
59 59
  * @return boolean
60 60
  */
61 61
 	protected function _enabled() {
62  
-		return (($this->_View->cacheAction != false)) && (Configure::read('Cache.check') === true);
  62
+		return $this->_View->cacheAction && (Configure::read('Cache.check') === true);
63 63
 	}
64 64
 
65 65
 /**

0 notes on commit 8dc4de5

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