Skip to content

Enforce correct @throws tag on all functions#1359

Merged
williamjallen merged 1 commit into
Kitware:masterfrom
williamjallen:phpstan-exceptions-2
Apr 18, 2023
Merged

Enforce correct @throws tag on all functions#1359
williamjallen merged 1 commit into
Kitware:masterfrom
williamjallen:phpstan-exceptions-2

Conversation

@williamjallen
Copy link
Copy Markdown
Collaborator

This PR enables PHPStan's @throws annotation checking functionality. Any Exception or RuntimeException is assumed to be an "unchecked" exception which is supposed to crash the application. Any other exception is a "checked" exception, and must be specified in an @throws annotation.

It is probable that many of our current usages of RuntimeException are not meant to be unchecked, and should be converted to checked exceptions eventually.

@zackgalbreath zackgalbreath self-requested a review April 18, 2023 20:28
@williamjallen williamjallen merged commit fdb073a into Kitware:master Apr 18, 2023
@williamjallen williamjallen deleted the phpstan-exceptions-2 branch April 18, 2023 20:30
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.

2 participants