rspec/rules/S2194/php/rule.adoc

28 lines
552 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
``++include_once++`` and ``++include++`` only generate a warning if an error occurs during the operation. Because of this they should only be used after possible error conditions have been checked.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
----
include_once $user.'_history.php'; // Noncompliant
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
----
if (is_member($user)) {
include_once $user.'_history.php';
}
----
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]