-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ext/sqlite3: SQLite3::close, SQLite3Stmt::close and SQLite3Result::fi… #10878
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
base: master
Are you sure you want to change the base?
Conversation
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 I agree in theory, but I worry there are people doing:
if ($db->close()) { ... }
else { ... }
will have the code logic completely changed. But then waiting for PHP 9 for this changes means we would need to change the return types again :/
UPGRADING
Outdated
@@ -102,6 +102,10 @@ PHP 8.3 UPGRADE NOTES | |||
argument is non empty with the class not having constructor. | |||
. pg_insert now raises a ValueError instead of a WARNING when the table specified is invalid. | |||
|
|||
- Sqlite: | |||
. SQLite3::close, SQLite3Result::finalize and SQLite3Stmt::close are void. | |||
Previously, they returned bool. |
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.
Previously, they returned bool. | |
Previously, they always returned true. |
Seems more accurate
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
ext/sqlite3/sqlite3.stub.php
Outdated
@@ -312,7 +312,7 @@ public function __construct(string $filename, int $flags = SQLITE3_OPEN_READWRIT | |||
public function open(string $filename, int $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, string $encryptionKey = ""): void {} | |||
|
|||
/** @return bool */ |
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 comment needs to be removed and I think also replaced with /** @tentative-return-type */
Is this correct @kocsismate ?
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.
looking at another void function, you seem to be correct.
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, you are right
@@ -436,5 +436,5 @@ public function fetchArray(int $mode = SQLITE3_BOTH): array|false {} | |||
public function reset(): bool {} | |||
|
|||
/** @return bool */ | |||
public function finalize() {} // TODO make return type void | |||
public function finalize(): void {} |
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.
Ditto
…nalize changed from bool return value to void.
66aae9d
to
ffb1a1f
Compare
I'd love if the signatures in question could be fixed, but I'm also worried about the unsatisfactory upgrade path which I mentioned in a similar PR. I'm afraid we cannot silently change these signatures this fundamentally :( IMO at least there should be an RFC in order to provoke a discussion and in order to settle on a solution which the majority accepts. |
I agree. The |
Those are fair points indeed. |
I agree. This path is more reasonable. It will not change the logic, but will encourage people to change the code what will allow to change the return type to |
…nalize
changed from bool return value to void.