-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Introduce properties for SQL parts in QueryBuilder #3836
Conversation
@morozov Do you know what's wrong with phpcs? How can I early exit here? |
Please try --- a/lib/Doctrine/DBAL/Query/QueryParts.php
+++ b/lib/Doctrine/DBAL/Query/QueryParts.php
@@ -67,8 +67,10 @@ class QueryParts
$this->where = clone $this->where;
}
- if ($this->having !== null) {
- $this->having = clone $this->having;
+ if ($this->having === null) {
+ return;
}
+
+ $this->having = clone $this->having;
}
} See slevomat/coding-standard#371 for the reference. |
Kills readability in this specific case, if you ask me. Should I proceed anyway? |
I agree (hence the issue). However, I'd prefer to format the code according to the standard instead of having to maintain an exception in |
Fixed in 00b4f89. |
@morozov All good for me. Let me know if you see anything else! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good for me. Let me know if you see anything else!
Apart from the nitpicks, looks good. Love the removal of the add()
implementation.
@morozov All done! Ready for your review. |
@morozov Ready for review, once again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the upgrade notes, looks good. Let's get it merged.
Squashed! |
Ugh. All assertions are static, and this method isn't. How can this even work?? Anyway, all fixed, and squashed again. |
Thanks, @BenMorel! All good this time. |
Summary
This supersedes #3829. Now that #3830 and #3833 have introduced
From
andJoin
objects,it's time to replace the.$sqlParts
associative array with an explicit object, namelyQueryParts
Update: the SQL parts are now part of
QueryBuilder
itself.