rspec/rules/S5855/php/rule.adoc

22 lines
328 B
Plaintext
Raw Normal View History

== Why is this an issue?
include::../description.adoc[]
=== Noncompliant code example
2022-02-04 17:28:24 +01:00
[source,php]
----
"/[ab]|a/" // The "|a" is redundant because "[ab]" already matches "a"
"/.*|a/" // .* matches everything, so any other alternative is redundant
----
=== Compliant solution
2022-02-04 17:28:24 +01:00
[source,php]
----
"/[ab]/"
"/.*/"
2022-02-04 17:28:24 +01:00
----