我将我的项目更新到 Symfony 3.3。我想为服务使用新的自动配置功能。我试图摆脱,$this->get()
但我在控制器和命令中有错误。
在控制器中使用下面的代码示例,我有这个错误:
recapitulatifCollesAction() requires that you provide a value for the "$checkGele" argument. Either the argument is nullable and no null value has been provided, no default value has been provided or because there is a non optional argument after this one.
在命令中,我根本不知道如何摆脱$container->get()
。
你知道我怎样才能让它工作吗?
控制器:
public function recapitulatifCollesAction($estEnCours, CheckGeleService $checkGele)
{
// ...
$checkGele->getGeleAutorisation($colle);
// ...
}
我的配置:
services:
_defaults:
autowire: true
autoconfigure: true
public: false
编辑:修改 config.yml 后出现新错误