【发布时间】:2017-12-29 09:05:15
【问题描述】:
我正在从 symofony 2.7 迁移到 symfony 4.0。成功地我迁移了一个包。现在我正在迁移第二个捆绑包,并且出现错误消息。我完全没有得到 symfony 4.0 想要从我这里得到的东西。
如果我打开autowire: true,就会出现此错误消息。
Cannot autowire service "App\Kernel": argument "$environment" of method "Symfony\Component\HttpKernel\Kernel::__construct()" must have a type-hint or be given a value explicitly.
有人可以帮帮我吗?
如果我将其关闭,则不会出现任何消息。
更新
我只在 bundles.php 中注册了我的包
App\Backend\AccountBundle\BackendAccountBundle::class => ['all' => true],
【问题讨论】:
-
你能粘贴你的配置文件吗?目前它会尝试自动装配您的内核。
-
默认来自 symfony4。但我的问题有更新
-
我对配置文件更感兴趣,例如
config/services.yaml在这里您可以定义有关自动装配的所有内容。