Code Inspection: Assignment can be replaced with operator assignment
Configure inspections: Settings | Editor | Inspections
Show intention actions: AltEnter
Reports the assignments that can be replaced with combined operator assignments (for example, +=
).
In the following example, the assignment expression is replaced with the combined operator assignment.
Before the quick-fix
$myVar = $myVar . '\n';
After the quick-fix
$myVar .= '\n';
Place the caret at the highlighted line and press AltEnter or click
.
Click the arrow next to the inspection you want to suppress and select the necessary suppress action.