Skip to content

Adding new resetContainer method to Di class and updating tests - #427

Merged
armanist merged 1 commit into
quantum-php:masterfrom
armanist:master
Mar 15, 2026
Merged

armanist merged 1 commit into
quantum-php:masterfrom
armanist:master

Conversation

@armanist

@armanist armanist commented Mar 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Introduced new functionality for more granular control of dependency injection resets, allowing the container to be cleared independently while maintaining registered dependencies, separate from the comprehensive reset operation.
  • Tests

    • Added comprehensive test coverage validating the behavior of the new container reset operation and its distinction from the full reset.

@coderabbitai

coderabbitai Bot commented Mar 15, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a65a02a5-6fac-4987-8264-26810277d429

📥 Commits

Reviewing files that changed from the base of the PR and between 362afb8 and f3199af.

📒 Files selected for processing (2)
  • src/Di/Di.php
  • tests/Unit/Di/DiTest.php

📝 Walkthrough

Walkthrough

The Di class gains a new public method resetContainer() that clears the container and resolving stacks independently from clearing dependencies. The existing reset() method is updated to invoke this new method alongside its existing functionality, enabling more granular control over Di state management.

Changes

Cohort / File(s) Summary
Di Container Reset Logic
src/Di/Di.php
Adds new resetContainer(): void method to clear container and resolving stacks; modifies reset() to call the new method in addition to clearing dependencies.
Di Container Tests
tests/Unit/Di/DiTest.php
Adds testDiResetContainer unit test verifying that resetContainer() clears the container while leaving dependencies populated, contrasting with the behavior of reset().

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A container cleared, yet memories remain,
Dependencies safe from the reset's refrain,
Granular control, so precise and so neat,
The Di class evolves—truly making it sweet! 🌱

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding a new resetContainer method to the Di class and updating related tests.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Mar 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.63%. Comparing base (362afb8) to head (f3199af).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #427   +/-   ##
=========================================
  Coverage     82.62%   82.63%           
- Complexity     2717     2718    +1     
=========================================
  Files           241      241           
  Lines          7298     7300    +2     
=========================================
+ Hits           6030     6032    +2     
  Misses         1268     1268           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@armanist
armanist merged commit aea827b into quantum-php:master Mar 15, 2026
7 checks passed
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.

1 participant