-
Notifications
You must be signed in to change notification settings - Fork 34
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
Provider injection with Set attribute #262
Conversation
Codecov Report
@@ Coverage Diff @@
## 2.x #262 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 320 324 +4
===========================================
Files 37 40 +3
Lines 826 842 +16
===========================================
+ Hits 826 842 +16
Continue to review full report at Codecov.
|
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.
Set
以外は既存の機能(モジュールとProvider)を利用して実現できているのがすごいです!
動的ファクトリー生成のインジェクトがたったこれだけで書けるのかという |
src/di/Injector.php
Outdated
@@ -38,6 +38,7 @@ public function __construct($module = null, string $tmpDir = '') | |||
|
|||
$module = $module ?? new NullModule(); | |||
$module->install(new AssistedModule()); | |||
$module->install(new InjectingProviderModule()); |
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.
これだけ!
Co-authored-by: Naoki Tsuchiya <ntsuchiya1105@gmail.com>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
This PR supports the injection of lazily instantiated objects.
closes #261
* "パラメーターのアノテーション"は無いのでパラメーター指定もなく、インジェクションポイントからアノテーションを読みに行くのも煩雑で一旦(リクエストない限り)PHP8のアトリビュートのみ対応
Provider injection
Multibinder