有谁知道在 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/