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

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

<RuleId id="format/strings/complex-variable" />

Not in any preset. Safe fix.

## What it does

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

## Configuration

```toml title="pun.toml"
[format.rules]
"strings/complex-variable" = true
```

To skip it in some files, add a [`@pun-ignore-file`](/docs/configuration/ignore-comments) comment.

## Replaces

- [`simple_to_complex_string_variable`](https://cs.symfony.com/doc/rules/string_notation/simple_to_complex_string_variable.html) (php-cs-fixer)

[More format/strings rules](/docs/rules/format/strings) · [Edit this page](https://github.com/shipfastlabs/pun/edit/main/crates/pun-config/rules/mapping.toml)
