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 702ec911d..18c25baa8 100644 --- a/lib/Cake/Controller/Component/EmailComponent.php +++ b/lib/Cake/Controller/Component/EmailComponent.php @@ -316,7 +316,7 @@ class EmailComponent extends Component { 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 854312686..434146eb4 100644 --- a/lib/Cake/Controller/Scaffold.php +++ b/lib/Cake/Controller/Scaffold.php @@ -146,7 +146,7 @@ class Scaffold { $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 462170371..7e9220f65 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -2561,7 +2561,7 @@ class Model extends Object implements CakeEventListener { * @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 3ebcea3f8..c6328b72b 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); } /**