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

Use better typing in QueryBuilder #4220

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
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
Next Next commit
Reuse already computed $elements
It makes it easier for Psalm (and arguably for humans) to understand
this piece of code.
  • Loading branch information
greg0ire committed Aug 23, 2020
commit ec9557e4800bb993d1842df1eaecbcaf02fdd2ff
4 changes: 2 additions & 2 deletions lib/Doctrine/DBAL/Query/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1363,8 +1363,8 @@ private function getSQLForJoins($fromAlias, array &$knownAliases)
public function __clone()
{
foreach ($this->sqlParts as $part => $elements) {
if (is_array($this->sqlParts[$part])) {
foreach ($this->sqlParts[$part] as $idx => $element) {
if (is_array($elements)) {
foreach ($elements as $idx => $element) {
if (! is_object($element)) {
continue;
}
Expand Down