---
title: "format/operators/new-expression-parentheses"
pagination: false
---

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

<RuleId id="format/operators/new-expression-parentheses" />

Not in any preset. Safe fix.

## What it does

All `new` expressions with a further call must (not) be wrapped in parentheses.

## Configuration

```toml title="pun.toml"
[format.rules]
"operators/new-expression-parentheses" = true
```

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

## Options

| Name | Type | Allowed values | Default | Upstream name |
| --- | --- | --- | --- | --- |
| `use-parentheses` | `bool` | Any | `false` | `use_parentheses` |

## Replaces

- [`new_expression_parentheses`](https://cs.symfony.com/doc/rules/operator/new_expression_parentheses.html) (php-cs-fixer)
- [`NewMethodCallWithoutParentheses`](https://getrector.com/rule-detail/new-method-call-without-parentheses-rector) (rector)

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