format/strings/implicit-backslashes
Not in any preset. Safe fix.
What it does
Handles implicit backslashes in strings and heredocs. Depending on the chosen strategy, it can escape implicit backslashes to ease the understanding of which are special chars interpreted by PHP and which not (escape), or it can remove these additional backslashes if you find them superfluous (unescape). You can also leave them as-is using ignore strategy.
Configuration
[format.rules]
"strings/implicit-backslashes" = true
To skip it in some files, add a @pun-ignore-file comment.
Options
| Name | Type | Allowed values | Default | Upstream name |
|---|---|---|---|---|
double-quoted |
enum |
escape, unescape, ignore |
"escape" |
double_quoted |
heredoc |
enum |
escape, unescape, ignore |
"escape" |
heredoc |
single-quoted |
enum |
escape, unescape, ignore |
"unescape" |
single_quoted |
Replaces
string_implicit_backslashes(php-cs-fixer)