Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

lint/operators/prefer-coalesce-assign

In the lint-recommended preset and every stricter one. In Rector’s rector/php74 set. Safe fix.

What it does

Use the null coalescing assignment operator ??= where possible.

Configuration

[lint.rules]
"operators/prefer-coalesce-assign" = "error"

To skip it in some files, add an override or a @pun-ignore-file comment.

Replaces

More lint/operators rules · Edit this page

Last updated on

Was this page helpful?