laravel-mongodb
laravel-mongodb copied to clipboard
Respect Laravel's new accessors
Fix getting a value from \Illuminate\Database\Eloquent\Casts\Attribute-returning accessors (issue #2363).
Codecov Report
Merging #2394 (5a5eb96) into master (f4c448f) will increase coverage by
0.01%. The diff coverage is100.00%.
:exclamation: Current head 5a5eb96 differs from pull request most recent head 5d292a2. Consider uploading reports for the commit 5d292a2 to get more accurate results
@@ Coverage Diff @@
## master #2394 +/- ##
============================================
+ Coverage 87.62% 87.63% +0.01%
- Complexity 676 677 +1
============================================
Files 31 31
Lines 1551 1553 +2
============================================
+ Hits 1359 1361 +2
Misses 192 192
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/Eloquent/Model.php | 93.71% <100.00%> (+0.08%) |
:arrow_up: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Whats the status of this PR?
I've managed to fix the issue, but the cs-fixer denied my code for some reason. As the code in php-cs-fixer details doesn't give any clue, I would be very happy if anyone could explain me, what exactly I have to fix in order to have my pull request accepted :)
This is a breaking change and is this related to embedded relation?
@divine this change isn't specifically related to an embedded relation as this case may also happen when using other types of relations. I'm not sure if it's really a breaking change because all this code does is performs an additional check whether requested attribute returns an Attribute object or not. Without that change, a null s being returned in case of a one-worded attribute, which is obviously a bug.
Closed in favor of #2438.