Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
orklah committed Dec 4, 2020
1 parent 2228162 commit f08bfcc
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions hooks/InsaneComparisonAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,21 @@ public static function afterExpressionAnalysis(

$eligible_string = null;
foreach ($string_operand->getAtomicTypes() as $possibly_string) {
if ($possibly_string instanceof TLiteralString && preg_match('#[a-zA-Z]#', $possibly_string->value[0] ?? '')) {
$eligible_string = $possibly_string;
break;
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] ?? '')) {
$eligible_string = $possibly_string;
break;
if(preg_match('#[a-zA-Z]#', $possibly_string->value[0] ?? '')) {
$eligible_string = $possibly_string;
break;
}
continue;
} elseif ($possibly_string instanceof Type\Atomic\TNumericString) {
// not interested
continue;
} elseif ($possibly_string instanceof Type\Atomic\TString) {
$eligible_string = $possibly_string;
break;
Expand Down

0 comments on commit f08bfcc

Please sign in to comment.