PHPCSStandards / PHPCSUtils

A suite of utility functions for use with PHP_CodeSniffer
https://phpcsutils.com/
GNU Lesser General Public License v3.0
53 stars 7 forks source link

Start using the new exceptions #599

Closed jrfnl closed 3 months ago

jrfnl commented 4 months ago

Start using the new exceptions throughout PHPCSUtils

This implements the use of the new exceptions introduced in #598 in all the right places in PHPCSUtils.

Notes:

Only catch what should be caught

This changes the exceptions being caught in various catch statements to more specific ones.

This means that errors which should always have been thrown, will now throw and only the potentially expected (and acceptable) exceptions will now be caught.

Note:

Includes test for where the behaviour of the functions is now different.

jrfnl commented 3 months ago

Rebased without changes, other than squashing the "catch change/test" commit into the commit making the catch changes. Marking as ready as https://github.com/PHPCSStandards/PHPCSUtils/pull/598 has been merged now. Merging once the build passes.