Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Register only one error handler in swallowDeprecationNotices() #404

Merged
merged 1 commit into from
Dec 8, 2016

Conversation

adrium
Copy link
Contributor

@adrium adrium commented Dec 7, 2016

Handlers are not popped correctly in __invoke():

$handler from swallowDeprecationNotices() is still active after running the application which again swallows all errors after Zend\Expressive\Application finished execution.

The modified test passes for this commit, but it does not in the previous (but it should).

Edit: Would it be desired to also open a corresponding issue?

@adrium adrium force-pushed the hotfix/404 branch 2 times, most recently from 0b1ca49 to 910792d Compare December 8, 2016 12:27
$handler = function ($errno, $errstr) {
if ($errno !== E_USER_DEPRECATED) {
return false;
$handler = function ($errno, $errstr, $errfile, $errline, $errcontext) use (&$previous) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need to define $previous prior to declaring this handler; references can sometimes lead to issues otherwise.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can make this change on merge.

@weierophinney weierophinney added this to the 1.0.5 milestone Dec 8, 2016
@weierophinney weierophinney merged commit 910792d into zendframework:master Dec 8, 2016
weierophinney added a commit that referenced this pull request Dec 8, 2016
Register only one error handler in `swallowDeprecationNotices()`
weierophinney added a commit that referenced this pull request Dec 8, 2016
weierophinney added a commit that referenced this pull request Dec 8, 2016
weierophinney added a commit that referenced this pull request Dec 8, 2016
@weierophinney
Copy link
Member

Thanks, @adrium

@adrium
Copy link
Contributor Author

adrium commented Dec 8, 2016

The PR might seem a bit fussy, but I like Expressive and that was something I could contribute :)

You'll need to define $previous prior to declaring this handler; references can sometimes lead to issues otherwise.

I am interested in what cases? I tested it with error_reporting(~0) and it was ok... Actually, I had $previous = null previously in a commit I force push overwrote.

@adrium adrium deleted the hotfix/404 branch December 8, 2016 21:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants