-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat(database): Add replacements for deprecated fetch and fetchAll #40655
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?
Changes from all commits
35968f2
e1fb2a6
a6c3a7d
4968328
d25712d
c2d5024
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -57,15 +57,37 @@ public function closeCursor(): bool; | |||||
| * @return mixed | ||||||
| * | ||||||
| * @since 21.0.0 | ||||||
| * @deprecated 28.0.0 use fetchAssociative instead of fetch(), fetchNumeric instead of fetch(\PDO::FETCH_NUM) and fetchOne instead of fetch(\PDO::FETCH_COLUMN) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
🤪
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and more brackets for lonely |
||||||
| */ | ||||||
| public function fetch(int $fetchMode = PDO::FETCH_ASSOC); | ||||||
|
|
||||||
| /** | ||||||
| * Returns the next row of the result as an associative array or FALSE if there are no more rows. | ||||||
| * | ||||||
| * @return array<string,mixed>|false | ||||||
| * @throws Exception | ||||||
| * | ||||||
| * @since 28.0.0 | ||||||
| */ | ||||||
| public function fetchAssociative(): array|false; | ||||||
|
|
||||||
| /** | ||||||
| * Returns an array containing all of the result rows represented as associative arrays | ||||||
| * | ||||||
| * @return list<array<string,mixed>> | ||||||
| * @throws Exception | ||||||
| * | ||||||
| * @since 28.0.0 | ||||||
| */ | ||||||
| public function fetchAllAssociative(): array; | ||||||
|
|
||||||
| /** | ||||||
| * @param int $fetchMode (one of PDO::FETCH_ASSOC, PDO::FETCH_NUM or PDO::FETCH_COLUMN (2, 3 or 7) | ||||||
| * | ||||||
| * @return mixed[] | ||||||
| * | ||||||
| * @since 21.0.0 | ||||||
| * @deprecated 28.0.0 use fetchAllAssociative instead of fetchAll(), fetchAllNumeric instead of fetchAll(FETCH_NUM) and fetchOne instead of fetchAll(FETCH_COLUMN) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
🤪
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm tired, boss |
||||||
| */ | ||||||
| public function fetchAll(int $fetchMode = PDO::FETCH_ASSOC): array; | ||||||
|
|
||||||
|
|
@@ -77,6 +99,26 @@ public function fetchAll(int $fetchMode = PDO::FETCH_ASSOC): array; | |||||
| */ | ||||||
| public function fetchColumn(); | ||||||
|
|
||||||
| /** | ||||||
| * Returns the next row of the result as a numeric array or FALSE if there are no more rows | ||||||
| * | ||||||
| * @return list<mixed>|false | ||||||
| * @throws Exception | ||||||
| * | ||||||
| * @since 28.0.0 | ||||||
| */ | ||||||
| public function fetchNumeric(): array|false; | ||||||
|
|
||||||
| /** | ||||||
| * Returns an array containing all of the result rows represented as numeric arrays | ||||||
| * | ||||||
| * @return list<list<mixed>> | ||||||
| * @throws Exception | ||||||
| * | ||||||
| * @since 28.0.0 | ||||||
| */ | ||||||
| public function fetchAllNumeric(): array; | ||||||
|
|
||||||
| /** | ||||||
| * Returns the first value of the next row of the result or FALSE if there are no more rows. | ||||||
| * | ||||||
|
|
@@ -86,6 +128,16 @@ public function fetchColumn(); | |||||
| */ | ||||||
| public function fetchOne(); | ||||||
|
|
||||||
| /** | ||||||
| * Returns an array containing the values of the first column of the result | ||||||
| * | ||||||
| * @return list<mixed> | ||||||
| * @throws Exception | ||||||
| * | ||||||
| * @since 28.0.0 | ||||||
| */ | ||||||
| public function fetchFirstColumn(): array; | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be mixed?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it returns the first column of all results as
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The description is not phrased clearly about that imo, and for better consistency perhaps consider renaming the method to |
||||||
|
|
||||||
| /** | ||||||
| * @return int | ||||||
| * | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.