Skip to content

Commit

Permalink
Better document accepted types
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Jan 28, 2020
1 parent 11b5cc9 commit 0af7922
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions lib/Doctrine/DBAL/Query/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ public function add($sqlPartName, $sqlPart, $append = false)
* Specifies an item that is to be returned in the query result.
* Replaces any previously specified selections, if any.
*
* USING AN ARRAY ARGUMENT IS DEPRECATED. This feature will be removed in the next major version.
* USING AN ARRAY ARGUMENT IS DEPRECATED. Pass each value as an individual argument.
*
* <code>
* $qb = $conn->createQueryBuilder()
Expand All @@ -460,11 +460,12 @@ public function add($sqlPartName, $sqlPart, $append = false)
* ->leftJoin('u', 'phonenumbers', 'p', 'u.id = p.user_id');
* </code>
*
* @param string ...$select The selection expressions.
* @param string|string[]|null $select The selection expression. USING AN ARRAY OR NULL IS DEPRECATED.
* Pass each value as an individual argument. Pass at least one value.
*
* @return $this This QueryBuilder instance.
*/
public function select($select = null)
public function select($select = null/*, string ...$selects*/)
{
$this->type = self::SELECT;

Expand Down Expand Up @@ -499,7 +500,7 @@ public function distinct() : self
/**
* Adds an item that is to be returned in the query result.
*
* USING AN ARRAY ARGUMENT IS DEPRECATED. This feature will be removed in the next major version.
* USING AN ARRAY ARGUMENT IS DEPRECATED. Pass each value as an individual argument.
*
* <code>
* $qb = $conn->createQueryBuilder()
Expand All @@ -509,11 +510,12 @@ public function distinct() : self
* ->leftJoin('u', 'phonenumbers', 'u.id = p.user_id');
* </code>
*
* @param string ...$select The selection expression.
* @param string|string[]|null $select The selection expression. USING AN ARRAY OR NULL IS DEPRECATED.
* Pass each value as an individual argument. Pass at least one value.
*
* @return $this This QueryBuilder instance.
*/
public function addSelect($select = null)
public function addSelect($select = null/*, string ...$selects*/)
{
$this->type = self::SELECT;

Expand Down Expand Up @@ -873,7 +875,7 @@ public function orWhere($where)
* Specifies a grouping over the results of the query.
* Replaces any previously specified groupings, if any.
*
* USING AN ARRAY ARGUMENT IS DEPRECATED. This feature will be removed in the next major version.
* USING AN ARRAY ARGUMENT IS DEPRECATED. Pass each value as an individual argument.
*
* <code>
* $qb = $conn->createQueryBuilder()
Expand All @@ -882,11 +884,12 @@ public function orWhere($where)
* ->groupBy('u.id');
* </code>
*
* @param string ...$groupBy The grouping expression.
* @param string|string[] $groupBy The grouping expression. USING AN ARRAY IS DEPRECATED.
* Pass each value as an individual argument.
*
* @return $this This QueryBuilder instance.
*/
public function groupBy($groupBy)
public function groupBy($groupBy/*, string ...$groupBys*/)
{
if (empty($groupBy)) {
return $this;
Expand All @@ -900,7 +903,7 @@ public function groupBy($groupBy)
/**
* Adds a grouping expression to the query.
*
* USING AN ARRAY ARGUMENT IS DEPRECATED. This feature will be removed in the next major version.
* USING AN ARRAY ARGUMENT IS DEPRECATED. Pass each value as an individual argument.
*
* <code>
* $qb = $conn->createQueryBuilder()
Expand All @@ -910,11 +913,12 @@ public function groupBy($groupBy)
* ->addGroupBy('u.createdAt');
* </code>
*
* @param string ...$groupBy The grouping expression.
* @param string|string[] $groupBy The grouping expression. USING AN ARRAY IS DEPRECATED.
* Pass each value as an individual argument.
*
* @return $this This QueryBuilder instance.
*/
public function addGroupBy($groupBy)
public function addGroupBy($groupBy/*, string ...$groupBys*/)
{
if (empty($groupBy)) {
return $this;
Expand Down

0 comments on commit 0af7922

Please sign in to comment.