-
Notifications
You must be signed in to change notification settings - Fork 5
GitAuto: [FEATURE] Add Auto-Registration and Dependency Resolution to DI Container in Pancake #253
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
base: main
Are you sure you want to change the base?
GitAuto: [FEATURE] Add Auto-Registration and Dependency Resolution to DI Container in Pancake #253
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
|
Here's the code health analysis summary for commits Analysis Summary
|
|
|
||
| For more details, refer to the [DIContainer Documentation](docs/DIContainer.md). | ||
|
|
||
|
|
Check warning
Code scanning / Markdownlint (reported by Codacy)
Expected: 1; Actual: 3 Warning
| For more details, refer to the [DIContainer Documentation](docs/DIContainer.md). | ||
|
|
||
|
|
||
|
|
Check warning
Code scanning / Markdownlint (reported by Codacy)
Expected: 1; Actual: 2 Warning
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.
Phpcs (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
|
Infisical secrets check: ✅ No secrets leaked! 💻 Scan logs2025-12-04T17:13:05Z INF scanning for exposed secrets...
5:13PM INF 429 commits scanned.
2025-12-04T17:13:05Z INF scan completed in 680ms
2025-12-04T17:13:05Z INF no leaks found
|
Resolves #237
What is the feature
This feature introduces auto-registration and automatic dependency resolution to the Dependency Injection (DI) Container in the Pancake project. When enabled, the DI Container will automatically register services that are not explicitly registered and resolve all their dependencies, including constructor dependencies, recursively.
Why we need the feature
How to implement and why
Implementation Steps:
Modify the
DIContainerClass:$autoRegisterEnabledto control the auto-registration feature.true, making the feature enabled by default.resolveMethod:$services. If not found and auto-registration is enabled, proceed to auto-register.autoRegister($name)to handle the registration and resolution.autoRegisterMethod:resolveon the parameter's class name.newInstanceArgs.setAutoRegisterEnabled(bool $enabled)to allow enabling or disabling the feature at runtime.Handle Dependency Resolution:
Update Registration Methods:
registerSingletonandregisterTransientto ensure they work seamlessly with the new auto-registration feature.Write Unit Tests:
Write Integration Tests:
Update Documentation:
Why Implement This Way:
About backward compatibility
By carefully implementing the feature with these considerations, we ensure that current users of the Pancake DI Container can adopt the new functionality without disruption.
Test these changes locally