Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #17 - Error suppression operator is not fully honoured #18

Merged

Conversation

kAlvaro
Copy link
Contributor

@kAlvaro kAlvaro commented Oct 18, 2024

Warnings suppressed with @ were still altering the test status.

This is still not a full solution, because status is assigned separately for each error severity and I've only changed warnings. I wanted to get some feedback before spending more time on this.

@Bilge
Copy link
Member

Bilge commented Oct 18, 2024

All changes look good to me 👍🏻

Copy link

codecov bot commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (e71b10a) to head (f44ae07).
Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##              master       #18   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity        61        64    +3     
===========================================
  Files              6         6           
  Lines            143       146    +3     
===========================================
+ Hits             143       146    +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kAlvaro
Copy link
Contributor Author

kAlvaro commented Oct 21, 2024

I've added the same fix for notices and deprecations. I don't think you can use @ for any other severity types (I tried triggering E_USER_ERROR and it wasn't being caught).

While working on this, I found another issue, but it's a different thing and I don't know how it's meant to work so I'll probably open an issue to discuss it.

@kAlvaro kAlvaro marked this pull request as ready for review October 21, 2024 10:00
@Bilge
Copy link
Member

Bilge commented Oct 21, 2024

E_USER_ERROR is a separate event. It should be possible to handle it in Printer::trace, although I haven't tried. In any case, I think we can add support for USER level events later.

.gitignore Outdated Show resolved Hide resolved
test/CapabilitiesTest.php Outdated Show resolved Hide resolved
@kAlvaro
Copy link
Contributor Author

kAlvaro commented Oct 21, 2024

E_USER_ERROR is a separate event. It should be possible to handle it in Printer::trace, although I haven't tried. In any case, I think we can add support for USER level events later.

Honestly, I only tried that because I couldn't think of a way to trigger a regular error on purpose.

@Bilge
Copy link
Member

Bilge commented Oct 21, 2024

E_USER_ERROR is a separate event. It should be possible to handle it in Printer::trace, although I haven't tried. In any case, I think we can add support for USER level events later.

Honestly, I only tried that because I couldn't think of a way to trigger a regular error on purpose.

Easiest way is to search php-src for E_ERROR and pick one that's easy to reproduce.

@Bilge Bilge merged commit 3111fb5 into ScriptFUSION:master Oct 21, 2024
7 checks passed
@Bilge
Copy link
Member

Bilge commented Oct 21, 2024

Thanks for this @kAlvaro!

@kAlvaro kAlvaro deleted the feature/issue-17-error-suppression-operator branch October 21, 2024 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants