Skip to content

Commit f3fe4a6

Browse files
committed
Fix docblock.
Formatter callbacks don't receive query as argument.
1 parent 7aa78fd commit f3fe4a6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Datasource/QueryTrait.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,7 @@ public function mapReduce(callable $mapper = null, callable $reducer = null, $ov
270270
* to fetch the results from the database.
271271
*
272272
* Formatting callbacks will get a first parameter, a `ResultSetDecorator`, that
273-
* can be traversed and modified at will. As for the second parameter, the
274-
* formatting callback will receive this query instance.
273+
* can be traversed and modified at will.
275274
*
276275
* Callbacks are required to return an iterator object, which will be used as
277276
* the return value for this query's result. Formatter functions are applied
@@ -287,12 +286,12 @@ public function mapReduce(callable $mapper = null, callable $reducer = null, $ov
287286
*
288287
* ```
289288
* // Return all results from the table indexed by id
290-
* $query->select(['id', 'name'])->formatResults(function ($results, $query) {
289+
* $query->select(['id', 'name'])->formatResults(function ($results) {
291290
* return $results->indexBy('id');
292291
* });
293292
*
294293
* // Add a new column to the ResultSet
295-
* $query->select(['name', 'birth_date'])->formatResults(function ($results, $query) {
294+
* $query->select(['name', 'birth_date'])->formatResults(function ($results) {
296295
* return $results->map(function ($row) {
297296
* $row['age'] = $row['birth_date']->diff(new DateTime)->y;
298297
* return $row;

0 commit comments

Comments
 (0)