Skip to content

Commit 13ab7d2

Browse files
committed
improved phpDoc
1 parent 7071db6 commit 13ab7d2

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/Database/ResultSet.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public function fetchAssoc(?string $path = null): ?array
204204

205205

206206
/**
207-
* Returns the next row as an object Row or null if there are no more rows.
207+
* Returns the next row as a Row object or null if there are no more rows.
208208
*/
209209
public function fetch(): ?Row
210210
{
@@ -248,7 +248,9 @@ public function fetchFields(): ?array
248248

249249

250250
/**
251-
* Returns all rows as associative array.
251+
* Returns all rows as associative array, where first argument specifies key column and second value column.
252+
* For duplicate keys, the last value is used. When using null as key, array is indexed from zero.
253+
* Alternatively accepts callback returning value or key-value pairs.
252254
*/
253255
public function fetchPairs(string|int|\Closure|null $keyOrCallback = null, string|int|null $value = null): array
254256
{
@@ -257,7 +259,7 @@ public function fetchPairs(string|int|\Closure|null $keyOrCallback = null, strin
257259

258260

259261
/**
260-
* Returns all rows.
262+
* Returns all remaining rows as array of Row objects.
261263
* @return Row[]
262264
*/
263265
public function fetchAll(): array

src/Database/Table/Selection.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public function get(mixed $key): ?ActiveRow
183183

184184

185185
/**
186-
* Fetches next row of result.
186+
* Returns the next row or null if there are no more rows.
187187
* @return T|null
188188
*/
189189
public function fetch(): ?ActiveRow
@@ -215,7 +215,9 @@ public function fetchField(?string $column = null): mixed
215215

216216

217217
/**
218-
* Fetches all rows as associative array.
218+
* Returns all rows as associative array, where first argument specifies key column and second value column.
219+
* For duplicate keys, the last value is used. When using null as key, array is indexed from zero.
220+
* Alternatively accepts callback returning value or key-value pairs.
219221
*/
220222
public function fetchPairs(string|int|\Closure|null $keyOrCallback = null, string|int|null $value = null): array
221223
{
@@ -224,7 +226,7 @@ public function fetchPairs(string|int|\Closure|null $keyOrCallback = null, strin
224226

225227

226228
/**
227-
* Fetches all rows.
229+
* Returns all rows.
228230
* @return T[]
229231
*/
230232
public function fetchAll(): array
@@ -235,6 +237,7 @@ public function fetchAll(): array
235237

236238
/**
237239
* Returns all rows as associative tree.
240+
* @deprecated
238241
*/
239242
public function fetchAssoc(string $path): array
240243
{

0 commit comments

Comments
 (0)