From 8dc4de5de8454a55b961def4efc5c47ffa6af0f6 Mon Sep 17 00:00:00 2001 From: dogmatic69 Date: Fri, 21 Sep 2012 23:32:52 +0100 Subject: [PATCH] converting if ($foo != false) to if ($foo) --- lib/Cake/Controller/Component/EmailComponent.php | 2 +- lib/Cake/Controller/Scaffold.php | 2 +- lib/Cake/Model/Model.php | 2 +- lib/Cake/View/Helper/CacheHelper.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Cake/Controller/Component/EmailComponent.php b/lib/Cake/Controller/Component/EmailComponent.php index 702ec911d1c..18c25baa846 100644 --- a/lib/Cake/Controller/Component/EmailComponent.php +++ b/lib/Cake/Controller/Component/EmailComponent.php @@ -316,7 +316,7 @@ public function send($content = null, $template = null, $layout = null) { foreach ($this->headers as $key => $value) { $headers['X-' . $key] = $value; } - if ($this->date != false) { + if ($this->date) { $headers['Date'] = $this->date; } $lib->setHeaders($headers); diff --git a/lib/Cake/Controller/Scaffold.php b/lib/Cake/Controller/Scaffold.php index 85431268611..434146eb451 100644 --- a/lib/Cake/Controller/Scaffold.php +++ b/lib/Cake/Controller/Scaffold.php @@ -146,7 +146,7 @@ public function __construct(Controller $controller, CakeRequest $request) { $this->controller->viewClass = 'Scaffold'; } $this->_validSession = ( - isset($this->controller->Session) && $this->controller->Session->valid() != false + isset($this->controller->Session) && $this->controller->Session->valid() ); $this->_scaffold($request); } diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index 46217037149..7e9220f65a3 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -2561,7 +2561,7 @@ public function exists($id = null) { * @return boolean True if such a record exists */ public function hasAny($conditions = null) { - return ($this->find('count', array('conditions' => $conditions, 'recursive' => -1)) != false); + return (bool)$this->find('count', array('conditions' => $conditions, 'recursive' => -1)); } /** diff --git a/lib/Cake/View/Helper/CacheHelper.php b/lib/Cake/View/Helper/CacheHelper.php index 3ebcea3f8b7..c6328b72bf9 100644 --- a/lib/Cake/View/Helper/CacheHelper.php +++ b/lib/Cake/View/Helper/CacheHelper.php @@ -59,7 +59,7 @@ class CacheHelper extends AppHelper { * @return boolean */ protected function _enabled() { - return (($this->_View->cacheAction != false)) && (Configure::read('Cache.check') === true); + return $this->_View->cacheAction && (Configure::read('Cache.check') === true); } /**