rspec/rules/S1172/php/rule.adoc

59 lines
909 B
Plaintext

== Why is this an issue?
include::../description.adoc[]
=== Exceptions
Functions in classes that override a class or implement interfaces are ignored.
[source,php]
----
class C extends B {
function doSomething($a, $b) { // no issue reported on $b
compute($a);
}
}
----
== How to fix it
include::../how-to-fix-it.adoc[]
=== Code examples
==== Noncompliant code example
[source,php,diff-id=1,diff-type=noncompliant]
----
function doSomething($a, $b) { // "$a" is unused
return compute($b);
}
----
==== Compliant solution
[source,php,diff-id=1,diff-type=compliant]
----
function doSomething($b) {
return compute($b);
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]