function PEAR::delExpect
This method deletes all occurrences of the specified element from the expected error codes stack.
@access public @since PHP 4.3.0
Parameters
mixed $error_code error code that should be deleted:
Return value
mixed list of error codes that were deleted or error
File
-
vendor/
pear/ pear-core-minimal/ src/ PEAR.php, line 463
Class
- PEAR
- Base class for other PEAR classes. Provides rudimentary emulation of destructors.
Code
function delExpect($error_code) {
$deleted = false;
if (is_array($error_code) && 0 != count($error_code)) {
// $error_code is a non-empty array here; we walk through it trying
// to unset all values
foreach ($error_code as $key => $error) {
$deleted = $this->_checkDelExpect($error) ? true : false;
}
return $deleted ? true : PEAR::raiseError("The expected error you submitted does not exist");
// IMPROVE ME
}
elseif (!empty($error_code)) {
// $error_code comes alone, trying to unset it
if ($this->_checkDelExpect($error_code)) {
return true;
}
return PEAR::raiseError("The expected error you submitted does not exist");
// IMPROVE ME
}
// $error_code is empty
return PEAR::raiseError("The expected error you submitted is empty");
// IMPROVE ME
}