-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix: getVersion()
for OCI8 and SQLSRV drivers
#9471
base: develop
Are you sure you want to change the base?
Conversation
@@ -29,6 +29,12 @@ final class GetVersionTest extends CIUnitTestCase | |||
|
|||
public function testGetVersion(): void | |||
{ | |||
if ($this->db->DBDriver === 'MySQLi') { |
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 should can use if ($this->db instanceof \CodeIgniter\Database\MySQLi\Connection)
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.
Yes, but since this type of comparison is widely used in our tests, I personally find it more readable. However, if others prefer the change, I'm happy to update it.
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.
The benefit of instanceof is phpstan will be fixed for no property notice
getVersion()
for OCI8 driver when no connection is establishedgetVersion()
for OCI8 and SQLSRV drivers
Description
This PR fixes a bug in OCI8 and SQLSRV
getVersion()
method, which will return an empty string when no connection is established.Issue discovered in #9469
Checklist: