Skip to content

Commit 0af7922

Browse files
committed
Better document accepted types
1 parent 11b5cc9 commit 0af7922

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

lib/Doctrine/DBAL/Query/QueryBuilder.php

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ public function add($sqlPartName, $sqlPart, $append = false)
451451
* Specifies an item that is to be returned in the query result.
452452
* Replaces any previously specified selections, if any.
453453
*
454-
* USING AN ARRAY ARGUMENT IS DEPRECATED. This feature will be removed in the next major version.
454+
* USING AN ARRAY ARGUMENT IS DEPRECATED. Pass each value as an individual argument.
455455
*
456456
* <code>
457457
* $qb = $conn->createQueryBuilder()
@@ -460,11 +460,12 @@ public function add($sqlPartName, $sqlPart, $append = false)
460460
* ->leftJoin('u', 'phonenumbers', 'p', 'u.id = p.user_id');
461461
* </code>
462462
*
463-
* @param string ...$select The selection expressions.
463+
* @param string|string[]|null $select The selection expression. USING AN ARRAY OR NULL IS DEPRECATED.
464+
* Pass each value as an individual argument. Pass at least one value.
464465
*
465466
* @return $this This QueryBuilder instance.
466467
*/
467-
public function select($select = null)
468+
public function select($select = null/*, string ...$selects*/)
468469
{
469470
$this->type = self::SELECT;
470471

@@ -499,7 +500,7 @@ public function distinct() : self
499500
/**
500501
* Adds an item that is to be returned in the query result.
501502
*
502-
* USING AN ARRAY ARGUMENT IS DEPRECATED. This feature will be removed in the next major version.
503+
* USING AN ARRAY ARGUMENT IS DEPRECATED. Pass each value as an individual argument.
503504
*
504505
* <code>
505506
* $qb = $conn->createQueryBuilder()
@@ -509,11 +510,12 @@ public function distinct() : self
509510
* ->leftJoin('u', 'phonenumbers', 'u.id = p.user_id');
510511
* </code>
511512
*
512-
* @param string ...$select The selection expression.
513+
* @param string|string[]|null $select The selection expression. USING AN ARRAY OR NULL IS DEPRECATED.
514+
* Pass each value as an individual argument. Pass at least one value.
513515
*
514516
* @return $this This QueryBuilder instance.
515517
*/
516-
public function addSelect($select = null)
518+
public function addSelect($select = null/*, string ...$selects*/)
517519
{
518520
$this->type = self::SELECT;
519521

@@ -873,7 +875,7 @@ public function orWhere($where)
873875
* Specifies a grouping over the results of the query.
874876
* Replaces any previously specified groupings, if any.
875877
*
876-
* USING AN ARRAY ARGUMENT IS DEPRECATED. This feature will be removed in the next major version.
878+
* USING AN ARRAY ARGUMENT IS DEPRECATED. Pass each value as an individual argument.
877879
*
878880
* <code>
879881
* $qb = $conn->createQueryBuilder()
@@ -882,11 +884,12 @@ public function orWhere($where)
882884
* ->groupBy('u.id');
883885
* </code>
884886
*
885-
* @param string ...$groupBy The grouping expression.
887+
* @param string|string[] $groupBy The grouping expression. USING AN ARRAY IS DEPRECATED.
888+
* Pass each value as an individual argument.
886889
*
887890
* @return $this This QueryBuilder instance.
888891
*/
889-
public function groupBy($groupBy)
892+
public function groupBy($groupBy/*, string ...$groupBys*/)
890893
{
891894
if (empty($groupBy)) {
892895
return $this;
@@ -900,7 +903,7 @@ public function groupBy($groupBy)
900903
/**
901904
* Adds a grouping expression to the query.
902905
*
903-
* USING AN ARRAY ARGUMENT IS DEPRECATED. This feature will be removed in the next major version.
906+
* USING AN ARRAY ARGUMENT IS DEPRECATED. Pass each value as an individual argument.
904907
*
905908
* <code>
906909
* $qb = $conn->createQueryBuilder()
@@ -910,11 +913,12 @@ public function groupBy($groupBy)
910913
* ->addGroupBy('u.createdAt');
911914
* </code>
912915
*
913-
* @param string ...$groupBy The grouping expression.
916+
* @param string|string[] $groupBy The grouping expression. USING AN ARRAY IS DEPRECATED.
917+
* Pass each value as an individual argument.
914918
*
915919
* @return $this This QueryBuilder instance.
916920
*/
917-
public function addGroupBy($groupBy)
921+
public function addGroupBy($groupBy/*, string ...$groupBys*/)
918922
{
919923
if (empty($groupBy)) {
920924
return $this;

0 commit comments

Comments
 (0)