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

This commit is contained in:
dogmatic69 2012-09-21 23:32:52 +01:00
parent b1f26b59a3
commit 8dc4de5de8
4 changed files with 4 additions and 4 deletions

View file

@ -316,7 +316,7 @@ class EmailComponent extends Component {
foreach ($this->headers as $key => $value) { foreach ($this->headers as $key => $value) {
$headers['X-' . $key] = $value; $headers['X-' . $key] = $value;
} }
if ($this->date != false) { if ($this->date) {
$headers['Date'] = $this->date; $headers['Date'] = $this->date;
} }
$lib->setHeaders($headers); $lib->setHeaders($headers);

View file

@ -146,7 +146,7 @@ class Scaffold {
$this->controller->viewClass = 'Scaffold'; $this->controller->viewClass = 'Scaffold';
} }
$this->_validSession = ( $this->_validSession = (
isset($this->controller->Session) && $this->controller->Session->valid() != false isset($this->controller->Session) && $this->controller->Session->valid()
); );
$this->_scaffold($request); $this->_scaffold($request);
} }

View file

@ -2561,7 +2561,7 @@ class Model extends Object implements CakeEventListener {
* @return boolean True if such a record exists * @return boolean True if such a record exists
*/ */
public function hasAny($conditions = null) { 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));
} }
/** /**

View file

@ -59,7 +59,7 @@ class CacheHelper extends AppHelper {
* @return boolean * @return boolean
*/ */
protected function _enabled() { protected function _enabled() {
return (($this->_View->cacheAction != false)) && (Configure::read('Cache.check') === true); return $this->_View->cacheAction && (Configure::read('Cache.check') === true);
} }
/** /**