-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Refactor BaseActiveRecord::getDirtyAttributes()
#283
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #283 +/- ##
============================================
- Coverage 88.02% 87.79% -0.23%
+ Complexity 587 580 -7
============================================
Files 7 7
Lines 1319 1311 -8
============================================
- Hits 1161 1151 -10
- Misses 158 160 +2 ☔ View full report in Codecov by Sentry. |
PR Summary
|
# Conflicts: # src/BaseActiveRecord.php
} | ||
|
||
return $values; | ||
return array_intersect_key($attributes, array_flip($names)); |
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.
Could you bench it?
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.
What about oldAttributes
?
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.
Could you bench it?
Before:
benchGetAttributes......................R1 I1 - Mo20.920μs (±1.00%)
After:
benchGetAttributes......................R2 I2 - Mo17.238μs (±1.78%)
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.
What about
oldAttributes
?
getOldAttributes()
is a different method, without changes.
# Conflicts: # tests/ActiveRecordTest.php
$attributes
if no class properties) for table row values.