Conversation
Tigrov
commented
May 2, 2026
| Q | A |
|---|---|
| Is bugfix? | ✔️ |
| New feature? | ❌ |
| Breaks BC? | ❌ |
| Fixed issues | #525 |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Fixes an infinite recursion that can occur with PHP property hooks (e.g., relation properties implemented via get hooks) by changing how ActiveRecord reads raw property values, and adds regression coverage.
Changes:
- Switch
ActiveRecord::propertyValuesInternal()fromget_object_vars()to a newArArrayHelper::propertyValues()implementation based on(array)$objectcasting. - Add a stub model property hook for a relation (
Item::$category) and a regression test covering relation access/mutation through the hook. - Simplify
PrivatePropertiesTraitby removing itspropertyValuesInternal()override.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/Stubs/ActiveRecord/Item.php | Adds a relation defined via a property hook (category) to reproduce the hook scenario. |
| tests/ActiveRecordTest.php | Adds a regression test validating relation access/assignment through the property hook. |
| src/Trait/PrivatePropertiesTrait.php | Removes the now-unneeded propertyValuesInternal() override (but leaves an unused import). |
| src/Internal/ArArrayHelper.php | Adds propertyValues() helper to extract raw object properties without triggering hooks. |
| src/ActiveRecord.php | Uses the new helper for propertyValuesInternal() to avoid hook-triggered recursion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #567 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 656 658 +2
===========================================
Files 43 43
Lines 1626 1638 +12
===========================================
+ Hits 1626 1638 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
# Conflicts: # tests/ActiveRecordTest.php