Skip to content

Conversation

@henriquemoody
Copy link
Member

Because of how PHP works, when we instantiate an Exception object, the file and line properties are the file and line where we created the object. That's a desirable behaviour, but there's no value for a user to know that we created an instance of ValidationException in the Validator class.

This commit will overwrite the file and line in the ValidationException to where the method assert() was called.

Note that when running check() it will still point to Validator, but I decided not to change it, as the method check() got deprecated.

Because of how PHP works, when we instantiate an Exception object, the
`file` and `line` properties are the file and line where we created the
object. That's a desirable behaviour, but there's no value for a user to
know that we created an instance of `ValidationException` in the
`Validator` class.

This commit will overwrite the file and line in the
`ValidationException` to where the method `assert()` was called.

Note that when running `check()` it will still point to `Validator`, but
I decided not to change it, as the method `check()` got deprecated.
@henriquemoody henriquemoody marked this pull request as ready for review December 18, 2024 18:49
@codecov
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.56%. Comparing base (aa293de) to head (75a9b8e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1499   +/-   ##
=========================================
  Coverage     96.56%   96.56%           
- Complexity      977      978    +1     
=========================================
  Files           201      201           
  Lines          2414     2417    +3     
=========================================
+ Hits           2331     2334    +3     
  Misses           83       83           

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

@henriquemoody henriquemoody merged commit 75a9b8e into Respect:main Dec 18, 2024
8 checks passed
@henriquemoody henriquemoody deleted the core/exception branch December 18, 2024 18:51
@henriquemoody henriquemoody added this to the 3.0 milestone Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant