PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTML » HTML_QuickForm » Bug #8329

unnecessary if-else

Details

Request #8329unnecessary if-else
Submitted2006-07-31 13:46 UTC
Fromyoghoyogho at fastmail dot fm
Assignedavb
StatusClosed
PackageHTML_QuickForm
PHP Version5.1.2
Roadmaps(Not assigned)

Comments

[2006-07-31 13:46 UTC] yoghoyogho at fastmail dot fm

Description:
------------
See http://cvs.php.net/viewvc.cgi/pear/HTML_QuickForm/QuickForm/file.php?revision=1.20&view=markup

There's an unnecessary if-else block in the method moveUploadedFile. The return value is a boolean, based on a boolean value from move_uploaded_file.

Test script:
---------------
I would replace:

if (move_uploaded_file($this->_value['tmp_name'], $dest . $fileName)) {
return true;
} else {
return false;
}

with:
return move_uploaded_file($this->_value['tmp_name'], $dest . $fileName);

See also http://www.php.net/move_uploaded_file for the possible return values (they're all boolean)