Skip to content

[String] snake() method changes in 7.1.2 breaks symfony/ux-translator #57612

Closed
@jmsche

Description

@jmsche

Symfony version(s) affected

7.1.2

Description

After upgrading to Symfony 7.1.2 this morning, Symfony UX Translator won't compile anymore with Webpack.

Here is part of the error:

Syntax Error: Missing initializer in const declaration. (1:39)

> 1 | export const THIS_VALUE_SHOULD_BE_FALSE. = {"id":"This value should be false.","translations":{"validators":{"en":"This value should be false.","fr":"Cette valeur doit \u00eatre fausse.","nl":"Deze waarde moet onwaar zijn."}}};

Downgrading symfony/string to 7.1.1 solves the issue.

How to reproduce

echo (new UnicodeString('This value should be false.'))->snake()->toString();
// symfony/string 7.1.1: this_value_should_be_false
// symfony/string 7.1.2: this_value_should_be_false.

Possible Solution

The bug has been introduced with this PR: #57497
Reverting this solves the issue.

I guess it is a BC break?

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions