Patch for issue 4475 of symfony/symfony.