Browse Source

Merge pull request #12174 from cakephp/saeideng-patch-1

4.x fix return type
Mark Story 7 years ago
parent
commit
ef7ed40ee1
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/Datasource/QueryTrait.php

+ 3 - 3
src/Datasource/QueryTrait.php

@@ -321,7 +321,7 @@ trait QueryTrait
      * @param callable|null $mapper The mapper callable.
      * @param callable|null $reducer The reducing function.
      * @param bool $overwrite Set to true to overwrite existing map + reduce functions.
-     * @return $this|array
+     * @return $this
      * @see \Cake\Collection\Iterator\MapReduce for details on how to use emit data to the map reducer.
      */
     public function mapReduce(callable $mapper = null, callable $reducer = null, $overwrite = false)
@@ -331,7 +331,7 @@ trait QueryTrait
         }
         if ($mapper === null) {
             if (!$overwrite) {
-                throw new InvalidArgumentException('$mapper can be null only when $overwrite is false.');
+                throw new InvalidArgumentException('$mapper can be null only when $overwrite is true.');
             }
 
             return $this;
@@ -384,7 +384,7 @@ trait QueryTrait
      *
      * @param callable|null $formatter The formatting callable.
      * @param bool|int $mode Whether or not to overwrite, append or prepend the formatter.
-     * @return $this|array
+     * @return $this
      */
     public function formatResults(callable $formatter = null, $mode = 0)
     {