-
-
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
Bump Psalm level to 5 #4094
Bump Psalm level to 5 #4094
Conversation
morozov
commented
Jun 20, 2020
Q | A |
---|---|
Type | improvement |
BC Break | no |
…t the end of connect()
|
||
if ($value === false) { | ||
return ''; | ||
} |
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.
So we don't consider this a BC-break?
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.
Yeah, this should be suppressed. I'm not sure if the “BC break” is the right term here because the new value corresponds to the documented return type while the old one didn't.
tests/Doctrine/Tests/DBAL/Functional/Driver/IBMDB2/DB2StatementTest.php
Outdated
Show resolved
Hide resolved
…he test and cannot return NULL
@@ -95,3 +95,8 @@ parameters: | |||
message: '~Method Doctrine\\DBAL\\Driver\\PDOSqlsrv\\Connection\:\:lastInsertId\(\) should return string but returns string\|false\|null\.~' | |||
paths: | |||
- %currentWorkingDirectory%/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php | |||
|
|||
- | |||
message: '~Method Doctrine\\DBAL\\Portability\\Connection::prepare\(\) should return Doctrine\\DBAL\\Statement but returns Doctrine\\DBAL\\Portability\\Statement\.~' |
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.
This is caused by the issue earlier identified in #4045:
The portability layer is currently implemented on two levels of abstraction at the same time: most of its components implement driver-level interfaces but the
Connection
class extends the DBAL connection.
Thanks @morozov ! |
The assertion was done to prove the method contract. It's expected to return a Your use case violates the API. You can define your own implementation (in fact, a mock) of the |