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

Remove Query\Builder::__constructor overload #2570

Merged
merged 1 commit into from Aug 23, 2023

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Aug 22, 2023

The constructor don't need to be overloaded to set the default grammar. It is read from the connection by default.

https://github.com/laravel/framework/blob/10.x/src/Illuminate/Database/Query/Builder.php#L246

@codecov-commenter
Copy link

codecov-commenter commented Aug 22, 2023

Codecov Report

Patch coverage: 90.00% and project coverage change: -0.03% ⚠️

Comparison is base (b484288) 90.58% compared to head (1cec6e8) 90.56%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2570      +/-   ##
============================================
- Coverage     90.58%   90.56%   -0.03%     
+ Complexity      748      747       -1     
============================================
  Files            34       34              
  Lines          1785     1781       -4     
============================================
- Hits           1617     1613       -4     
  Misses          168      168              
Files Changed Coverage Δ
src/Query/Builder.php 93.93% <83.33%> (-0.06%) ⬇️
src/Connection.php 89.02% <100.00%> (ø)
src/Eloquent/Builder.php 85.50% <100.00%> (ø)
src/Eloquent/Model.php 92.22% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

*/
public function newQuery()
{
return new self($this->connection, $this->processor);
return new self($this->connection, $this->grammar, $this->processor);
Copy link
Member Author

Choose a reason for hiding this comment

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

Identical to parent method, but provide a more specific @return type.

@@ -164,10 +164,10 @@ public function chunkById($count, callable $callback, $column = '_id', $alias =
/**
* @inheritdoc
*/
public function raw($expression = null)
public function raw($value = null)
Copy link
Member Author

Choose a reason for hiding this comment

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

Get the argument name from the parent method.

alcaeus
alcaeus previously approved these changes Aug 22, 2023
Copy link
Member

@jmikola jmikola left a comment

Choose a reason for hiding this comment

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

LGTM if my assumptions in the previous questions in GromNaN/laravel-mongodb#26 were correct.

@alcaeus
Copy link
Member

alcaeus commented Aug 23, 2023

@GromNaN LGTM. Can you rebase to resolve the conflicts in the changelog?

@GromNaN
Copy link
Member Author

GromNaN commented Aug 23, 2023

Rebased.

@alcaeus alcaeus merged commit 6c7df45 into mongodb:master Aug 23, 2023
9 of 12 checks passed
@GromNaN GromNaN deleted the query-builder-constructor branch August 23, 2023 09:27
@GromNaN GromNaN added this to the 4.0.0 milestone Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants