-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
add @throws declarations to docs in Connection #2810
add @throws declarations to docs in Connection #2810
Conversation
In a few cases methods in Connection may throw a DBALException which isn't declared in the docblock. As the Connection class is heavily used by third party code, this code runs the risk of ignoring those exceptions instead of handling them. While it is technically not required to declare exceptions in PHP, it is highly recommended, especially in public APIs.
To be honest I don't really understand the failure condition this patch is meeting in scrutinizer. Is a changed doc comment a failure condition? |
Oh, never mind. I see. There are other unrelated errors in doc comments. My patch doesn't fix those - as it shouldn't - which leads to the error in scrutinizer. |
lib/Doctrine/DBAL/Connection.php
Outdated
@@ -410,6 +412,8 @@ private function detectDatabasePlatform() | |||
* version without having to query it (performance reasons). | |||
* | |||
* @return string|null | |||
* | |||
* @throws \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.
Exception
is already imported
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.
True. Fixed.
@bestform thanks! |
anytime. Thanks for the merge. |
In a few cases methods in Connection may throw a DBALException which
isn't declared in the docblock. As the Connection class is heavily
used by third party code, this code runs the risk of ignoring
those exceptions instead of handling them. While it is
technically not required to declare exceptions in PHP, it is highly
recommended, especially in public APIs.
Fixes #2809