Introduce properties for SQL parts in QueryBuilder#3836
Introduce properties for SQL parts in QueryBuilder#3836morozov merged 1 commit intodoctrine:masterfrom
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! |
morozov
left a comment
There was a problem hiding this comment.
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. |
morozov
left a comment
There was a problem hiding this comment.
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
FromandJoinobjects,it's time to replace the.$sqlPartsassociative array with an explicit object, namelyQueryPartsUpdate: the SQL parts are now part of
QueryBuilderitself.