rspec/rules/S6035/php/rule.adoc

20 lines
296 B
Plaintext
Raw Normal View History

== Why is this an issue?
include::../description_without_reference_to_s5998.adoc[]
=== Noncompliant code example
2022-02-04 17:28:24 +01:00
[source,php]
----
preg_match("/a|b|c/", $str); // Noncompliant
----
=== Compliant solution
2022-02-04 17:28:24 +01:00
[source,php]
----
preg_match("/[abc]/", $str);
// or
preg_match("/[a-c]/", $str);
----