A bracket expression in a pattern names one character more than once
What it finds
A bracket expression in a pattern names one character more than once
<?php$a = preg_match('/^[a-zA-Z_0-9.-_]+$/', $name);tx0 reports: lists$b = preg_match('/^[\w_]+$/', $name);tx0 reports: lists _ more than once$c = preg_match('/^[a-z0-9._-]+$/', $name);$d = preg_match('/^[a-zA-Z]+$/i', $name); Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/php:regex-duplicate-class-member" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/php:regex-duplicate-class-member] reason="..."tx0 explain tx0/php:regex-duplicate-class-member shows the same in the terminal. Found a false positive? Report it.