Skip to content

added MorphToMany with testcases #2640

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

Closed
wants to merge 3 commits into from
Closed

Conversation

ithuis
Copy link

@ithuis ithuis commented Oct 12, 2023

Can you give this a try?

attach MorphToMany working

detaching works

sync working

cleanup
@GromNaN GromNaN self-requested a review October 13, 2023 00:36
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

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

There is code cleanup to do.

@@ -41,7 +43,7 @@ trait HybridRelations
public function hasOne($related, $foreignKey = null, $localKey = null)
{
// Check if it is a relation with an original model.
if (! is_subclass_of($related, MongoDBModel::class)) {
if (!is_subclass_of($related, MongoDBModel::class)) {
Copy link
Member

Choose a reason for hiding this comment

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

Our CS requires that there is a space after exclamation mark. I'll revert this changes with phpcbf before merging.

@codecov-commenter
Copy link

codecov-commenter commented Oct 26, 2023

Codecov Report

Merging #2640 (acfdb19) into 4.1 (849cb1f) will decrease coverage by 1.66%.
Report is 7 commits behind head on 4.1.
The diff coverage is 71.42%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@             Coverage Diff              @@
##                4.1    #2640      +/-   ##
============================================
- Coverage     91.04%   89.38%   -1.66%     
- Complexity      756      818      +62     
============================================
  Files            35       36       +1     
  Lines          1931     2110     +179     
============================================
+ Hits           1758     1886     +128     
- Misses          173      224      +51     
Files Coverage Δ
src/Eloquent/HybridRelations.php 85.23% <80.70%> (-3.55%) ⬇️
src/Relations/MorphToMany.php 66.94% <66.94%> (ø)

... and 3 files with indirect coverage changes

@GromNaN GromNaN added this to the 4.1 milestone Nov 2, 2023
@GromNaN
Copy link
Member

GromNaN commented Nov 22, 2023

Closing in favor of #2670

@GromNaN GromNaN closed this Nov 22, 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.

3 participants