This commit is contained in:
orklah 2020-12-07 15:43:36 +01:00
parent f08bfcc8dc
commit ae8d3e7b6b

View File

@ -105,13 +105,7 @@ class InsaneComparisonAnalyzer implements AfterExpressionAnalysisInterface
$eligible_string = null;
foreach ($string_operand->getAtomicTypes() as $possibly_string) {
if ($possibly_string instanceof TLiteralString) {
if(preg_match('#[a-zA-Z]#', $possibly_string->value[0] ?? '')) {
$eligible_string = $possibly_string;
break;
}
continue;
} elseif ($possibly_string instanceof TSingleLetter && preg_match('#[a-zA-Z]#', $possibly_string->value[0] ?? '')) {
if(preg_match('#[a-zA-Z]#', $possibly_string->value[0] ?? '')) {
if(!preg_match('#\D#', $possibly_string->value[0] ?? '')) {
$eligible_string = $possibly_string;
break;
}