Type-hint your constructor parameters and the container can guess which dependencies to inject. class Foo { private $bar; public function __construct(Bar $bar) { $this->bar = $bar; } } Covers 80% of the use cases with 0 configuration. Expressive configuration PHP-DI's configuration is written in PHP, allowing to benefit from auto-completion, static analysis and refactoring support with any IDE.
Other questions about DI Dependency Injection breaks Encapsulation Comments on Disco with Design Patterns: A Fresh Look at Dependency Injection Criticisms by so-called "experts" A simplified definition Conclusion References Amendment History Comments Introduction Way back in 2004 I made the following observation: There are two ways in which an idea, principle or rule can be implemented - indiscrim
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く