41 lines
727 B
Plaintext
41 lines
727 B
Plaintext
== Why is this an issue?
|
|
|
|
include::../description.adoc[]
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,php]
|
|
----
|
|
$i = $a + $b; // Noncompliant; calculation result not used before value is overwritten
|
|
$i = compute();
|
|
----
|
|
|
|
=== Compliant solution
|
|
|
|
[source,php]
|
|
----
|
|
$i = $a + $b;
|
|
$i += compute();
|
|
----
|
|
|
|
=== Exceptions
|
|
|
|
This rule ignores initializations to -1, 0, 1, ``++null++``, ``++true++``, ``++false++``, ``++""++``, ``++[]++`` and ``++array()++``.
|
|
|
|
include::../see.adoc[]
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::../comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|