rspec/rules/S2757/php/fix.adoc
Fred Tingaud 49e4aff3ec
Modify Rule S2757: LaYC =+
Co-authored-by: Amélie Renard <44666826+amelie-renard-sonarsource@users.noreply.github.com>
2023-06-15 19:30:44 +02:00

19 lines
267 B
Plaintext

Replace the operators with a single one if that is the intention
[source,php]
----
$target = -5;
$num = 3;
$target -= $num; // target = -8
----
Or fix the spacing to avoid confusion
[source,php]
----
$target = -5;
$num = 3;
$target = -$num; // target = -3
----