rspec/rules/S3772/php/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

34 lines
765 B
Plaintext

== Why is this an issue?
When a function parameter has a nullable type, e.g., parameter ``++param++`` in ``++f(?int param)++``, it must be explicitly provided in every function call. A nullable-type parameter has no default value.
=== Noncompliant code example
[source,php]
----
function f(?int param) {}
f();
----
=== Compliant solution
[source,php]
----
function f(?int param) {}
f(0);
----
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
=== on 2 Nov 2016, 13:31:50 Ann Campbell wrote:
\[~yves.duboispelerin] what "bad thing" will happen if you violate this rule? We need to show the justification for making this a Bug, and also need to know that when evaluating severity.
endif::env-github,rspecator-view[]