
When an include is not surrounded by empty lines, its content is inlined on the same line as the adjacent content. That can lead to broken tags and other display issues. This PR fixes all such includes and introduces a validation step that forbids introducing the same problem again.
54 lines
1.1 KiB
Plaintext
54 lines
1.1 KiB
Plaintext
== Why is this an issue?
|
|
|
|
Calling a function or a method with fewer or more arguments than expected will raise a TypeError. This is usually a bug and should be fixed.
|
|
|
|
|
|
Provide missing arguments to the call, or define default values if there are fewer arguments.
|
|
|
|
Reduce the number of arguments provided by the function call, or add more parameter if there are more arguments than expected.
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,php]
|
|
----
|
|
function myFunction($a, $b, $c = null) {
|
|
//...
|
|
}
|
|
|
|
myFunction($a); // Noncompliant - 2 arguments are required
|
|
----
|
|
|
|
=== Exceptions
|
|
|
|
No issue is reported when arguments are used in the body of the function being called.
|
|
|
|
[source,php]
|
|
----
|
|
function myFunction() {
|
|
$arg_list = func_get_args();
|
|
//...
|
|
}
|
|
|
|
myFunction($a, $b);
|
|
----
|
|
|
|
include::../see.adoc[]
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
include::../highlighting.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::../comments-and-links.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|