-
-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: Remove redundant offset in shiftLeftRightAttribute
call in NestedSetsBehavior
class.
#17
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
Conversation
…n `NestedSetsBehavior` class.
WalkthroughThe change updates the argument in the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant NestedSetsBehavior
participant Database
User->>NestedSetsBehavior: Delete node
NestedSetsBehavior->>Database: Remove node
NestedSetsBehavior->>NestedSetsBehavior: afterDelete()
NestedSetsBehavior->>NestedSetsBehavior: shiftLeftRightAttribute($rightValue, -2)
NestedSetsBehavior->>Database: Update left/right attributes
Possibly related PRs
Suggested labels
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 phpcs (3.7.2)src/NestedSetsBehavior.phpWarning: PHP Startup: Invalid date.timezone value 'UTC', using 'UTC' instead in Unknown on line 0 Fatal error: Uncaught Error: Class "Phar" not found in /usr/local/bin/phpcs:3 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings
⏰ Context from checks skipped due to timeout of 90000ms (12)
🔇 Additional comments (1)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 85 85
===========================================
Files 2 2
Lines 458 458
===========================================
Hits 458 458 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR fixes a boundary issue in the nested set deletion logic by removing an unnecessary +1
offset when shifting node positions.
- Adjust shift range start from
$rightValue + 1
to$rightValue
for correct reindexing after deletion
Comments suppressed due to low confidence (1)
src/NestedSetsBehavior.php:177
- Consider adding or updating unit tests to cover the boundary case where a node is deleted, verifying that shifting starts at the correct right value without the +1 offset.
$this->shiftLeftRightAttribute($rightValue, -2);
Summary by CodeRabbit