弃用 |在 Symfony 2.8.18 的 Yaml 翻译文件中带有未引用内容的(管道)符号
Deprecated | (pipe) symbol with unquoted content in Yaml translation files in Symfony 2.8.18
我正在升级到 Symfony 2.8.18,我注意到 upgrade notes
中的以下评论
Deprecated usage of @, `, |, and > at the beginning of an unquoted
string
不清楚的是这是否包括 Yaml translations/content 如下:
info: |
You can upgrade to Ayrshire Minis Premium at any time. Just visit http://www.ayrshireminis.com for more information.
是否应修改为以下内容?
info: |
"You can upgrade to Ayrshire Minis Premium at any time. Just visit http://www.ayrshireminis.com for more information."
官方 Symfony 站点上的 New in Symfony 2.8: YAML deprecations 博客 post 没有给出示例或对此进行推断
他们至少可以正确使用术语。 YAML 中没有 未加引号的字符串 。从他们所说的,我推断他们的意思是 普通流标量 。
根据 YAML 规范,@
和 `
在此类标量的开头是非法的,因为它们是为将来使用而保留的。 |
和 >
显然是非法的,因为它们启动块标量。他们在他们的博客 post:
中给出了这个以前有效的例子
arguments: [`string`, |string, >string]
所以这意味着您不能在流内容中使用 |
和 >
来启动普通标量。这在理论上是允许的,因为它没有歧义,因为块标量不能存在于流内容中,但 YAML 规范仍然禁止它。
根据他们的解释,这对块标量没有影响(其他一切都意味着他们不再支持一项主要的 YAML 功能,这太奇怪了)。
我正在升级到 Symfony 2.8.18,我注意到 upgrade notes
中的以下评论Deprecated usage of @, `, |, and > at the beginning of an unquoted string
不清楚的是这是否包括 Yaml translations/content 如下:
info: |
You can upgrade to Ayrshire Minis Premium at any time. Just visit http://www.ayrshireminis.com for more information.
是否应修改为以下内容?
info: |
"You can upgrade to Ayrshire Minis Premium at any time. Just visit http://www.ayrshireminis.com for more information."
官方 Symfony 站点上的 New in Symfony 2.8: YAML deprecations 博客 post 没有给出示例或对此进行推断
他们至少可以正确使用术语。 YAML 中没有 未加引号的字符串 。从他们所说的,我推断他们的意思是 普通流标量 。
根据 YAML 规范,@
和 `
在此类标量的开头是非法的,因为它们是为将来使用而保留的。 |
和 >
显然是非法的,因为它们启动块标量。他们在他们的博客 post:
arguments: [`string`, |string, >string]
所以这意味着您不能在流内容中使用 |
和 >
来启动普通标量。这在理论上是允许的,因为它没有歧义,因为块标量不能存在于流内容中,但 YAML 规范仍然禁止它。
根据他们的解释,这对块标量没有影响(其他一切都意味着他们不再支持一项主要的 YAML 功能,这太奇怪了)。