Permalink
Browse files

Refactor GridFSFile isDirty and persisted bytes methods

  • Loading branch information...
1 parent c8ab5b4 commit b4bef51ee1188c5cebeeb92555e838f5e7da86bc @jmikola jmikola committed Nov 8, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/Doctrine/MongoDB/GridFSFile.php
View
12 lib/Doctrine/MongoDB/GridFSFile.php
@@ -195,13 +195,13 @@ public function write($filename)
/**
* Check if the file is dirty or set isDirty by passing a boolean argument.
*
- * @param boolean $bool
* @param boolean $isDirty
+ * @param boolean
*/
- public function isDirty($bool = null)
+ public function isDirty($isDirty = null)
{
- if ($bool !== null) {
- $this->isDirty = $bool;
+ if ($isDirty !== null) {
+ $this->isDirty = (boolean) $isDirty;
}
return $this->isDirty;
}
@@ -213,7 +213,7 @@ public function isDirty($bool = null)
*/
public function hasUnpersistedBytes()
{
- return $this->isDirty && $this->bytes ? true : false;
+ return ($this->isDirty && $this->bytes);
}
/**
@@ -223,6 +223,6 @@ public function hasUnpersistedBytes()
*/
public function hasUnpersistedFile()
{
- return $this->isDirty && $this->filename ? true : false;
+ return ($this->isDirty && $this->filename);
}
}

0 comments on commit b4bef51

Please sign in to comment.