rspec/rules/S122/php/rule.adoc

30 lines
591 B
Plaintext
Raw Permalink Normal View History

2023-06-16 15:38:45 +02:00
include::../rule.adoc[]
2020-06-30 10:16:44 +02:00
=== Exceptions
2020-06-30 10:16:44 +02:00
2023-06-16 15:38:45 +02:00
The rule ignores anonymous functions containing a single statement.
2021-02-02 15:02:10 +01:00
2023-06-16 15:38:45 +02:00
[source,php]
2020-06-30 10:16:44 +02:00
----
2023-06-16 15:38:45 +02:00
$max_comparator = function ($v) { return $v > 2; }; // Compliant by exception
2020-06-30 10:16:44 +02:00
$max_comparator = function ($v) { echo $v; return $v > 2; }; // Noncompliant
----
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[]