rspec/rules/S3699/php/rule.adoc

21 lines
606 B
Plaintext
Raw Normal View History

2020-06-30 12:48:39 +02:00
If a function does not return anything, it makes no sense to use its output. Specifically, passing it to another function, or assigning its "result" to a variable is probably a bug because such functions return nothing, which is probably not what was intended.
== Noncompliant Code Example
----
$result = closedir($dir_handle); // Noncompliant, "closedir" does not return anything.
----
== Compliant Solution
----
closedir($dir_handle);
----
ifdef::env-github,rspecator-view[]
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]