首页 > 解决方案 > 从 Symfony 4.3 开始不支持在多行块中映射键,并将在 5.0 中抛出 ParseException

问题描述

我有个问题。更新到 Symfony 4.4 后,我收到以下弃用警告 Support for mapping keys in multi-line blocks is deprecated since Symfony 4.3 and will throw a ParseException in 5.0. 2x in AccountControllerTest::testSettings from App\Tests\Controller 1x in AccountControllerTest::testPageUser from App\Tests\Controller

我完全不知道这意味着什么。

来自 App\Tests\Controller 的 testSettings:

    public function testSettings() {
    $crawler = self::$userClient->request('GET', '/nl/account/settings.html');
    $this->assertSuccesfulResponse(self::$userClient->getResponse());
    $crawler = $this->form(self::$userClient, $crawler, 'submit', array(), '/\/nl\/account/');
}

提前致谢!

标签: symfonydeprecatedmultilinedeprecation-warning

解决方案


这意味着您可能在 Yaml 文件的某处有一个多行键,并且 symfony 不支持它,在 symfony 5.0 中它会抛出异常而不是警告!

像这样的东西:

 this
 is
 multi
 key:  test

推荐阅读