Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed doc param inside Query Builder #2775

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/Doctrine/DBAL/Query/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ public function getMaxResults()
* 'groupBy', 'having' and 'orderBy'.
*
* @param string $sqlPartName
* @param string $sqlPart
* @param mixed $sqlPart
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably be string, no?

Copy link
Contributor Author

@AlessandroMinoccheri AlessandroMinoccheri Jul 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some part of the code for example in line 530 of the same file is passed as an array not as a string right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's because it's upcast (line 423)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I have seen but I thought that you can call this function with a string or with an array so I thought that mixed type is better than string inside documentation.
If It's better string I understand but there are two ways for me to call this function for that parameter

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlessandroMinoccheri use string|string[] or whatever matches then :-)

* @param boolean $append
*
* @return $this This QueryBuilder instance.
Expand All @@ -420,7 +420,7 @@ public function add($sqlPartName, $sqlPart, $append = false)
$isMultiple = is_array($this->sqlParts[$sqlPartName]);

if ($isMultiple && !$isArray) {
$sqlPart = array($sqlPart);
$sqlPart = [$sqlPart];
}

$this->state = self::STATE_DIRTY;
Expand Down