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

29 lines
566 B
Plaintext

include::../description.adoc[]
== Noncompliant Code Example
[source,php]
----
function makeyogurt($type = "acidophilus", $flavor){...} // Noncompliant
makeyogurt("raspberry")}} // Runtime error: Missing argument 2 in call to makeyogurt()
----
== Compliant Solution
[source,php]
----
function makeyogurt($flavor, $type = "acidophilus", ){...}
makeyogurt("raspberry")}} // Works as expected
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
endif::env-github,rspecator-view[]