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

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

Operators and their operands. Also in [lint](/docs/rules/lint/operators) (7) and [analyse](/docs/rules/analyse/operators) (15).

**[binary-spacing](/docs/rules/format/operators/binary-spacing)**

Binary operators should be surrounded by space as configured.

In the `format-laravel` and `format-psr12` presets. Safe fix.

**[concat-spacing](/docs/rules/format/operators/concat-spacing)**

Concatenation should be spaced according to configuration.

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

**[increment-style](/docs/rules/format/operators/increment-style)**

Pre- or post-increment and decrement operators should be used if possible.

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

**[linebreak](/docs/rules/format/operators/linebreak)**

Operators - when multiline - must always be at the beginning or at the end of the line.

Not in any preset. Safe fix.

**[new-expression-parentheses](/docs/rules/format/operators/new-expression-parentheses)**

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

Not in any preset. Safe fix.

**[new-parentheses](/docs/rules/format/operators/new-parentheses)**

All instances created with `new` keyword must (not) be followed by parentheses.

In the `format-laravel` and `format-psr12` presets. Safe fix.

**[no-space-around-arrow](/docs/rules/format/operators/no-space-around-arrow)**

There should not be space before or after object operators `->` and `?->`.

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

**[no-space-around-double-colon](/docs/rules/format/operators/no-space-around-double-colon)**

There must be no space around double colons (also called Scope Resolution Operator or Paamayim Nekudotayim).

In the `format-laravel` and `format-psr12` presets. Safe fix.

**[no-useless-concat](/docs/rules/format/operators/no-useless-concat)**

There should not be useless concat operations.

Not in any preset. Safe fix.

**[not-with-space](/docs/rules/format/operators/not-with-space)**

Logical NOT operators (`!`) should have leading and trailing whitespaces.

Not in any preset. Safe fix.

**[not-with-successor-space](/docs/rules/format/operators/not-with-successor-space)**

Logical NOT operators (`!`) should have one trailing whitespace.

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

**[standardize-increment](/docs/rules/format/operators/standardize-increment)**

Increment and decrement operators should be used if possible.

Not in any preset. Safe fix.

**[standardize-not-equals](/docs/rules/format/operators/standardize-not-equals)**

Replace all `<>` with `!=`.

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

**[ternary-spacing](/docs/rules/format/operators/ternary-spacing)**

Standardize spaces around ternary operator.

In the `format-laravel` and `format-psr12` presets. Safe fix.

**[unary-spacing](/docs/rules/format/operators/unary-spacing)**

Unary operators should be placed adjacent to their operands.

In the `format-laravel` and `format-psr12` presets. Safe fix.
