Skip to content

Commit

Permalink
converting if ($foo != false) to if ($foo)
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Sep 21, 2012
1 parent b1f26b5 commit 8dc4de5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Controller/Component/EmailComponent.php
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Controller/Scaffold.php
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Model/Model.php
Expand Up @@ -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));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/View/Helper/CacheHelper.php
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 8dc4de5

Please sign in to comment.