---
title: "format/strings"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

String literals, heredoc and nowdoc. Also in [lint](/docs/rules/lint/strings) (5) and [analyse](/docs/rules/analyse/strings) (2).

**[complex-variable](/docs/rules/format/strings/complex-variable)**

Converts explicit variables in double-quoted strings and heredoc syntax from simple to complex format (`${` to `{$`).

Not in any preset. Safe fix.

**[explicit-variable](/docs/rules/format/strings/explicit-variable)**

Converts implicit variables into explicit ones in double-quoted strings or heredoc syntax.

Not in any preset. Safe fix.

**[heredoc-closing-marker](/docs/rules/format/strings/heredoc-closing-marker)**

Unify `heredoc` or `nowdoc` closing marker.

Not in any preset. Safe fix.

**[heredoc-indentation](/docs/rules/format/strings/heredoc-indentation)**

Heredoc/nowdoc content must be properly indented.

Not in any preset. Safe fix.

**[heredoc-to-nowdoc](/docs/rules/format/strings/heredoc-to-nowdoc)**

Convert `heredoc` to `nowdoc` where possible.

In the `format-laravel` preset. Safe fix.

**[implicit-backslashes](/docs/rules/format/strings/implicit-backslashes)**

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.

Not in any preset. Safe fix.

**[multiline-to-heredoc](/docs/rules/format/strings/multiline-to-heredoc)**

Convert multiline string to `heredoc` or `nowdoc`.

Not in any preset. Safe fix.

**[no-binary](/docs/rules/format/strings/no-binary)**

There should not be a binary flag before strings.

In the `format-laravel` preset. Safe fix.

**[single-quote](/docs/rules/format/strings/single-quote)**

Convert double quotes to single quotes for simple strings.

In the `format-laravel` preset. Safe fix.
