Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
E_USER_DEPRECATED errors bypass error_level setting #3424
It appears that Codeception's
After a recent
I tried setting Codeception's
Error reporting appears to be correctly set from start to finish.
The issue appears to stem from the
As I understand it, setting PHP's error level via
On line 36 of the
Now, in the
Even though I've excluded
In my mind, there are two solutions:
Specify the handler's error types
We could specify the custom error handler's error types when we set it. This would remove the need to check the error types in the
Move the E_USER_DEPRECATED check
We could move the E_USER_DEPRECATED check in the
Either solution fixes the issue.
The first solution seems more correct. We shouldn't handle events only to not handle them, unless we want to suppress PHP's native error handling. The second solution is definitely a much smaller change.
I'm happy to make a pull request for either one. I wanted to check with the authors/contributors first, because there is plenty going on in here that I don't understand haha.
Which solution do you recommend?
Oh, cool. Thank you for the suggestion.
I don't use Symfony Deprecations Helper in my project, but I tried setting the
Unfortunately, it did not fix the issue.
You're right about supporting Symfony Deprecations Helper in the
It looks like the environment variable only matters if the Symfony PHPUnit Bridge component is installed, though (which makes sense).
I'm not dying to install a library just to turn it off (haha). I think Solution 2 from above (moving the E_USER_DEPRECATED check in
What do you think?
Oh, and thank you for always being so helpful and responsive with issues. Thank you and the Codeception team for a great testing framework!
I'm right there with you. Normally, I want to see deprecation messages.
Unfortunately, these notices are triggered and caused by libraries outside of my control. In this case, I'd just like to turn the notices off, because I can't fix them.
In my opinion, the Codeception
If you guys don't agree, it's no big deal. I just saw something I thought I could improve at a difficulty level I figured I could handle haha.
I definitely agree with @jstewmc on this matter. In my case I get a lot of deprecation warnings which are triggered by code I have totally no control over; I think it just pollutes the test report. I think that the user should be able to decide whether he wants to be notified of deprecations while testing or not. In my opinion, moving the aforementioned part of the code in the ErrorHandler::errorHandler method would be the best solution. In such cases, configurability is strongly desirable.