Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

Prevent fatal errors from leaking #214

Closed
wants to merge 1 commit into from
Closed

Prevent fatal errors from leaking #214

wants to merge 1 commit into from

Conversation

shadowhand
Copy link
Contributor

The errors generated during feature detection are sometimes picked up by
frameworks or libraries that use error_get_last() in a shutdown
handler to look for fatal errors.

This change forces an E_NOTICE error to be triggered when an error may
potentially be leaked, preventing false positives in most situations.

Fixes #209

The errors generated during feature detection are sometimes picked up by
frameworks or libraries that use `error_get_last()` in a shutdown
handler to look for fatal errors.

This change forces an `E_NOTICE` error to be triggered when an error may
potentially be leaked, preventing false positives in *most* situations.

Fixes #209
@codecov-io
Copy link

Codecov Report

Merging #214 into master will decrease coverage by 0.19%.
The diff coverage is 22.22%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #214     +/-   ##
========================================
- Coverage     100%   99.8%   -0.2%     
========================================
  Files         135     137      +2     
  Lines        7863    7814     -49     
========================================
- Hits         7863    7799     -64     
- Misses          0      15     +15
Impacted Files Coverage Δ
src/polyfill.php 0% <0%> (ø)
src/Polyfill/Errors.php 0% <0%> (ø)
src/Reflection/FeatureDetector.php 100% <100%> (ø) ⬆️
src/Event/EventSequence.php 98.38% <0%> (-1.62%) ⬇️
...ion/AbstractCardinalityVerifierEventCollection.php 98.87% <0%> (-1.13%) ⬇️
src/Spy/SpyData.php 99% <0%> (-1%) ⬇️
src/Verification/GeneratorVerifier.php 99.06% <0%> (-0.94%) ⬇️
src/Call/CallData.php 99.38% <0%> (-0.62%) ⬇️
src/Assertion/AssertionRenderer.php 99.89% <0%> (-0.11%) ⬇️
.../Detail/GeneratorAnswerBuilderDetailWithReturn.php 100% <0%> (ø) ⬆️
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1ef2236...553f074. Read the comment docs.

@shadowhand
Copy link
Contributor Author

@ezzatron this needs some cleanup, and either coverage being ignored or tested (probably the former?) and I don't know why Travis PHP 5.3 is failing. Leaving it here for now as a possible solution.

@ezzatron
Copy link
Contributor

PR seems like a good idea!

Ignore all my CI tools having a meltdown, I'm facing a whole bunch of issues there at the moment because of the large range of PHP versions I'm trying to support. I really need to drop some of the older ones soon to stay sane.

@ezzatron
Copy link
Contributor

@shadowhand Out of interest, do you use Phony for anything PHP 5.x? I'm trying to decide which versions of PHP to drop in future. At the moment I think I probably need to retain 5.6 support, but older 5.x versions can probably go.

@shadowhand
Copy link
Contributor Author

@ezzatron yes we're still stuck on PHP 5.6 until we complete PHP 7 migration. We're about 60% of the way there, will probably be using PHP 5.6 until year end at least.

@ezzatron ezzatron mentioned this pull request Apr 22, 2017
11 tasks
@ezzatron ezzatron added this to the Next release milestone Apr 22, 2017
@ezzatron ezzatron closed this in 095bd66 Apr 22, 2017
@shadowhand shadowhand deleted the fix/error-clear-last branch April 22, 2017 14:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants