dependency-injection - Symfony 服务严格参数

标签 dependency-injection symfony

有谁知道在 Symfony 中注入(inject)服务时“严格”参数的作用?

例如:

<service ...>
    <argument type="service" id="whatever" strict=false />
</service>

谢谢!

最佳答案

我做了一些研究,它是 leftover from Symfony 2.8 as this comment suggests :

Note: The $strict parameter is deprecated since version 2.8 and will be removed in 3.0.



从 3.0 开始,参数不存在以及弃用警告,但类 YamlFileLoader XmlFileLoader 即使 Reference 仍然阅读它class 只接受两个参数。

所以,这个参数什么都不做:)。

关于dependency-injection - Symfony 服务严格参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39698565/

相关文章:

wpf - 为什么要使用依赖注入(inject)容器?

java - 如何使用 guice 注入(inject)通用接口(interface)实现

php - 在 PHP Controller 中调用模型功能的最佳选择

c# - 为什么在此代码中使用 Func<T>?

php - 如何检查数据库连接

php - SQLSTATE[HY000] : General error: 1025 Error on rename error when dropping foreign key in Doctrine Migration

asp.net-mvc-3 - ASP.NET MVC 3 应用程序的扩展?

php - 如何停止正在监听 http ://127. 0.0.1:8000 的 symfony 进程

symfony - 脚本缓存:clear returned with error code 1

mysql - 错误“1038 Out of sort memory, consider increasing sort buffer size