Skip to content

PHPStan prepare exceptions#6037

Merged
Alkarex merged 3 commits intoFreshRSS:edgefrom
Alkarex:phpstan-exceptions
Jan 15, 2024
Merged

PHPStan prepare exceptions#6037
Alkarex merged 3 commits intoFreshRSS:edgefrom
Alkarex:phpstan-exceptions

Conversation

@Alkarex
Copy link
Member

@Alkarex Alkarex commented Jan 13, 2024

Take advantage of
https://phpstan.org/blog/bring-your-exceptions-under-control

Minimum changes to pass tooWideThrowType and implicitThrows.

Revert some mistakes from:
#5504
Preparation needed before new PRs of the same type:
#5962

Fix several wrong PHPDocs and catches:

Method ... has ...Exception in PHPDoc @throws tag but it's not thrown.

Dead catch - ...Exception is never thrown in the try block.

Take advantage of
https://phpstan.org/blog/bring-your-exceptions-under-control

Minimum changes to pass `tooWideThrowType` and `implicitThrows`.

Revert some mistakes from:
FreshRSS#5504
Preparation needed before new PRs of the same type:
FreshRSS#5962

Fix several wrong PHPDocs and catches:

> Method ... has ...Exception in PHPDoc @throws tag but it's not thrown.

> Dead catch - ...Exception is never thrown in the try block.
@Alkarex Alkarex added the System care Everything related to system care label Jan 13, 2024
@Alkarex Alkarex added this to the 1.24.0 milestone Jan 13, 2024
Comment on lines +53 to +59
exceptions:
check:
missingCheckedExceptionInThrows: false # TODO pass
tooWideThrowType: true
implicitThrows: false
checkedExceptionClasses:
- 'Minz_Exception'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the goal of this PR

@Alkarex Alkarex merged commit 314077a into FreshRSS:edge Jan 15, 2024
@Alkarex Alkarex deleted the phpstan-exceptions branch January 15, 2024 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

System care Everything related to system care

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant