Skip to content

Commit

Permalink
Removing return statements from File::__construct.
Browse files Browse the repository at this point in the history
  • Loading branch information
predominant committed Mar 28, 2010
1 parent f846005 commit 5f3f662
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions cake/libs/file.php
Expand Up @@ -88,7 +88,7 @@ class File extends Object {
* @param string $path Path to file
* @param boolean $create Create file if it does not exist (if true)
* @param integer $mode Mode to apply to the folder holding the file
* @access private
* @access public
*/
function __construct($path, $create = false, $mode = 0755) {
parent::__construct();
Expand All @@ -97,21 +97,12 @@ function __construct($path, $create = false, $mode = 0755) {
$this->name = basename($path);
}
$this->pwd();

if (!$this->exists()) {
if ($create === true) {
if ($this->safe($path) && $this->create() === false) {
return false;
}
} else {
return false;
}
}
!$this->exists() && $create === true && $this->safe($path) && $this->create();
}
/**
* Closes the current file if it is opened
*
* @access private
* @access public
*/
function __destruct() {
$this->close();
Expand Down

0 comments on commit 5f3f662

Please sign in to comment.