rspec/rules/S1854/php/rule.adoc

22 lines
414 B
Plaintext
Raw Normal View History

2020-06-30 12:47:33 +02:00
include::../description.adoc[]
== Noncompliant Code Example
----
$i = $a + $b; // Noncompliant; calculation result not used before value is overwritten
$i = compute();
----
== Compliant Solution
----
$i = $a + $b;
$i += compute();
----
== Exceptions
2021-01-27 13:42:22 +01:00
This rule ignores initializations to -1, 0, 1, ``++null++``, ``++true++``, ``++false++``, ``++""++``, ``++[]++`` and ``++array()++``.
2020-06-30 12:47:33 +02:00
include::../see.adoc[]