-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Get rid of error suppression #2210
Get rid of error suppression #2210
Conversation
- Thanks to intiilapa (Benoit Durand) - grep -r "@" library/Zend/ | grep -v "*" | grep -v "// @" used to identify suppressions - Used ErrorHandler to remove suppressions
The static review looks good for me. However I'll let this open for review for someone more |
There are some components affected that doesn't depend on Zend\Stdlib before. |
|
I found 2 places of |
@marc-mabe One of the places using error_get_last() requires its use due to a php limitation (I discovered that during testing yesterday) ; I'll look for the other locations however. |
ErrorHandler is simpler to implement and more consistent with usage across the framework; additionally, this is really simply completing an effort I thought I'd already accomplished a couple months ago. (It doesn't help that some new code crept in using error suppression, either.) |
@marc-mabe re: ErrorHandler::stop() + ErrorException -- I'll see if there are places that would be useful and update. Thanks. |
- Removed two cases where error_get_last() was being used in Cache component; instead, captures the return from ErrorHandler::stop() and calls its getMessage() method.
@Maks3w I think all of the questions @marc-mabe raised are answered at this point. |
ErrorHandler::start(E_WARNING); | ||
$fileHandle = fopen($this->filename, 'r'); | ||
ErrorHandler::stop(); | ||
if (false === $fileHandle) { | ||
throw new Exception\UnexpectedValueException("Cannot open '$this->filename' for reading"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//...
$error = ErrorHandler::stop();
if (false === $fileHandle) {
throw new Exception\UnexpectedValueException("Cannot open '$this->filename' for reading", 0, $error); // previous error
//...
…s previous exception - Per @mark-mabe - Any place where an exception is throw immediately following an ErrorHandler::stop() call should pass the result of that call as the previous exception.
…y/hotfix/remove-suppression-operator Get rid of error suppression
…s previous exception - Per @mark-mabe - Any place where an exception is throw immediately following an ErrorHandler::stop() call should pass the result of that call as the previous exception.
…y/hotfix/remove-suppression-operator Get rid of error suppression
…y/hotfix/remove-suppression-operator Get rid of error suppression
…s previous exception - Per @mark-mabe - Any place where an exception is throw immediately following an ErrorHandler::stop() call should pass the result of that call as the previous exception.
…y/hotfix/remove-suppression-operator Get rid of error suppression
…s previous exception - Per @mark-mabe - Any place where an exception is throw immediately following an ErrorHandler::stop() call should pass the result of that call as the previous exception.
…y/hotfix/remove-suppression-operator Get rid of error suppression
…y/hotfix/remove-suppression-operator Get rid of error suppression
…s previous exception - Per @mark-mabe - Any place where an exception is throw immediately following an ErrorHandler::stop() call should pass the result of that call as the previous exception.
…y/hotfix/remove-suppression-operator Get rid of error suppression
…y/hotfix/remove-suppression-operator Get rid of error suppression
…s previous exception - Per @mark-mabe - Any place where an exception is throw immediately following an ErrorHandler::stop() call should pass the result of that call as the previous exception.
…y/hotfix/remove-suppression-operator Get rid of error suppression
…y/hotfix/remove-suppression-operator Get rid of error suppression
…y/hotfix/remove-suppression-operator Get rid of error suppression
…y/hotfix/remove-suppression-operator Get rid of error suppression
…s previous exception - Per @mark-mabe - Any place where an exception is throw immediately following an ErrorHandler::stop() call should pass the result of that call as the previous exception.
…y/hotfix/remove-suppression-operator Get rid of error suppression
…y/hotfix/remove-suppression-operator Get rid of error suppression
…s previous exception - Per @mark-mabe - Any place where an exception is throw immediately following an ErrorHandler::stop() call should pass the result of that call as the previous exception.
…y/hotfix/remove-suppression-operator Get rid of error suppression
- Removed two cases where error_get_last() was being used in Cache component; instead, captures the return from ErrorHandler::stop() and calls its getMessage() method.
…s previous exception - Per @mark-mabe - Any place where an exception is throw immediately following an ErrorHandler::stop() call should pass the result of that call as the previous exception.
…y/hotfix/remove-suppression-operator Get rid of error suppression
…s previous exception - Per @mark-mabe - Any place where an exception is throw immediately following an ErrorHandler::stop() call should pass the result of that call as the previous exception.
…y/hotfix/remove-suppression-operator Get rid of error suppression
…s previous exception - Per @mark-mabe - Any place where an exception is throw immediately following an ErrorHandler::stop() call should pass the result of that call as the previous exception.
…y/hotfix/remove-suppression-operator Get rid of error suppression
identify suppressions