我正在使用PHP-DI库,它非常适合我的using a bootstrap and config file代码,正如PHP-DI文档所推荐的那样。我想获得每个测试类中的容器,这样我就可以通过使用$ $container->injectOn($this) as suggested in the PHP-DI documentation注入每个测试的所有依赖项https://github.com/PHP-DI/PHP-DI/issues/125
Fatal error: Uncaught Exception: The PHP-DI definition is not indexed by an entry name in the definitionarray in
0 C:\new_xampp\htdocs\project\vendor\php-di</em
我有一个Slim (slim4)应用程序,我为日志记录添加了Monolog。我将记录器添加到应用程序中,如下所示: LoggerInterface::class => function (ContainerInterface $c) { ...这对于在我的大多数类中注入记录器很好,只需执行以下操作:
public function __construct(Conta
我正在尝试使用,但我没有完全成功。在我的简单扫描中,在Wordpress主题中的控制器需要在构造函数中注入一个PostService和一个CategoryService: private $_postservice; public function __construct(PostService $postservice, CategoryService $categoryService){
v