NewExceptionsFromToString: 2 bugfixes + 1 enhancement by jrfnl · Pull Request #880 · PHPCompatibility/PHPCompatibility

added 3 commits

August 21, 2019 19:48
This property is not intended to be set via a custom ruleset, so the property should never have been `public`.
When an exception is thrown within a `try/catch` block, ignore it.

This changes the sniff, in that previously only one error per method would be thrown. Now, an error will be thrown for each `throw` tag not in a `try/catch`.

Fixes 863
This adds an additional check based on the docblock to attempt to catch exceptions thrown indirectly from this method.

If the docblock indicates that the function may throw an exception, trust it.

The additional check will only be run if search for the `throw` keyword didn't yield any errors.

Fixes 863

@jrfnl jrfnl mentioned this pull request

Aug 21, 2019

wimg

wimg approved these changes Aug 28, 2019

@jrfnl jrfnl mentioned this pull request

Aug 28, 2019

40 tasks