mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-04 14:46:19 +08:00
Merge pull request #15347 from KoJIT2009/di-support-instance-by-property-and-setters
di-support-instance-for-property
This commit is contained in:
@ -34,6 +34,7 @@ Yii Framework 2 Change Log
|
||||
- Enh #15221: Improved the `help/list-action-options` console command output for command options without a description (brandonkelly)
|
||||
- Enh #15332: Always check for availability of `openssl_pseudo_random_bytes`, even if LibreSSL is available (sammousa)
|
||||
- Enh #15335: Added `FileHelper::unlink()` that works well under all OSes (samdark)
|
||||
- Enh #15347: Add `Instance` support for object property in DI container (kojit2009)
|
||||
- Enh #15340: Test CHANGELOG.md for valid format (sammousa)
|
||||
- Enh #15360: Refactored `BaseConsole::updateProgress()` (developeruz)
|
||||
- Bug #15317: Regenerate CSRF token if an empty value is given (sammousa)
|
||||
|
||||
@ -375,6 +375,8 @@ class Container extends Component
|
||||
return $reflection->newInstanceArgs($dependencies);
|
||||
}
|
||||
|
||||
$config = $this->resolveDependencies($config);
|
||||
|
||||
if (!empty($dependencies) && $reflection->implementsInterface('yii\base\Configurable')) {
|
||||
// set $config as the last parameter (existing one will be overwritten)
|
||||
$dependencies[count($dependencies) - 1] = $config;
|
||||
|
||||
Reference in New Issue
Block a user