rspec/rules/S1854/php/rule.adoc
2022-02-04 16:28:24 +00:00

39 lines
698 B
Plaintext

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[]