-
Notifications
You must be signed in to change notification settings - Fork 1.9k
docs: remove unneeded @throws in CodeIgniter #7540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -310,8 +310,6 @@ private function configureKint(): void | |||
* makes all of the pieces work together. | |||
* | |||
* @return ResponseInterface|void | |||
* | |||
* @throws RedirectException |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since the method has LogicException
throw, how about change to @throws LogicException
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should write Exceptions in @throws
which should be caught in the client code.
LogicException should not be caught.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think adding @throws
doesn't mean it have to be caught in client code. It's a way of explicitly telling that calling the function may throw this exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paulbalandan Do you think we should write all Exceptions that may be thrown?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really all. Only those that are meant to be checked by the framework and/or user. Please read this PHPStan article for details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read the article.
I think checked exceptions should be caught. So we should write only checked exceptions in @throws
.
Something wrong with my understanding?
You forgot to fix \CodeIgniter\Test\FeatureTestTrait and \CodeIgniter\Test\FeatureTestCase. |
2d7ba06
to
0012fe3
Compare
@iRedds Thanks. Removed. |
Description
Closes #7434
See #7434 (comment)
Checklist: