Skip to content

Commit

Permalink
Merge pull request #10594 from edsrzf/encapsed-string-condition-order
Browse files Browse the repository at this point in the history
Switch condition order
  • Loading branch information
orklah authored Jan 25, 2024
2 parents e72ad06 + 68a1d1e commit c0e8d32
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ public static function analyze(
return false;
}

$part_type = $statements_analyzer->node_data->getType($part);

if ($part_type !== null) {
if ($part instanceof EncapsedStringPart) {
if ($literal_string !== null) {
$literal_string .= $part->value;
}
$non_empty = $non_empty || $part->value !== "";
} elseif ($part_type = $statements_analyzer->node_data->getType($part)) {
$casted_part_type = CastAnalyzer::castStringAttempt(
$statements_analyzer,
$context,
Expand Down Expand Up @@ -110,11 +113,6 @@ public static function analyze(
}
}
}
} elseif ($part instanceof EncapsedStringPart) {
if ($literal_string !== null) {
$literal_string .= $part->value;
}
$non_empty = $non_empty || $part->value !== "";
} else {
$all_literals = false;
$literal_string = null;
Expand Down

0 comments on commit c0e8d32

Please sign in to comment.