-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #4199 Do not hide unnecessary escape characters (ruudk)
This PR was squashed before being merged into the 4.x branch. Discussion ---------- Do not hide unnecessary escape characters Follow up of #4176, #4123 and #2712. Now that we have deprecated unnecessary escape in v3, we can change the behavior in v4. With this change, unnecessary will no longer be ignored, but handled like any other character. This allows for writing fully qualified class names like this: ```twig {{ constant('App\Entity\User::SOME_CONSTANT') }} ``` Instead of having to escape the `\` in v3: ```twig {{ constant('App\\Entity\\User::SOME_CONSTANT') }} ``` /cc `@fabpot` `@stof` Commits ------- 53c24bf Do not hide unnecessary escape characters
- Loading branch information
Showing
6 changed files
with
36 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--TEST-- | ||
Exception with bad line number | ||
--TEMPLATE-- | ||
{{ 'Foo\Bar' }} | ||
{{ 'Foo\\Bar' }} | ||
{{ 'Foo\\\Bar' }} | ||
{{ 'Foo\\\\Bar' }} | ||
--DATA-- | ||
return [] | ||
--EXPECT-- | ||
Foo\Bar | ||
Foo\Bar | ||
Foo\\Bar | ||
Foo\\Bar |
10 changes: 0 additions & 10 deletions
10
tests/Fixtures/functions/enum_cases/invalid_enum_escaping.test
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters