Skip to content

Commit

Permalink
Fix issues with build
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Nov 11, 2018
1 parent fe25530 commit a3dde47
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
14 changes: 6 additions & 8 deletions src/Psalm/Checker/Statements/Block/SwitchChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -556,14 +556,12 @@ public static function analyze(
if ($redefined_vars !== null) {
foreach ($redefined_vars as $var_id => $type) {
if (isset($case_context->switch_scope->break_vars[$var_id])) {
if (!isset($case_context->switch_scope->break_vars[$var_id])) {
unset($redefined_vars[$var_id]);
} else {
$redefined_vars[$var_id] = Type::combineUnionTypes(
$case_context->switch_scope->break_vars[$var_id],
$type
);
}
$redefined_vars[$var_id] = Type::combineUnionTypes(
$case_context->switch_scope->break_vars[$var_id],
$type
);
} else {
unset($redefined_vars[$var_id]);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Psalm/Type/Reconciler.php
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,7 @@ private static function handleLiteralEquality(
$did_remove_type = false;

foreach ($existing_var_atomic_types as $atomic_key => $_) {
if ($key !== $new_var_type) {
if ($atomic_key !== $new_var_type) {
$existing_var_type->removeType($atomic_key);
$did_remove_type = true;
} else {
Expand Down Expand Up @@ -1497,7 +1497,7 @@ private static function handleLiteralEquality(
$did_remove_type = false;

foreach ($existing_var_atomic_types as $atomic_key => $_) {
if ($key !== $new_var_type) {
if ($atomic_key !== $new_var_type) {
$existing_var_type->removeType($atomic_key);
$did_remove_type = true;
} else {
Expand Down Expand Up @@ -1542,7 +1542,7 @@ private static function handleLiteralEquality(
$did_remove_type = false;

foreach ($existing_var_atomic_types as $atomic_key => $_) {
if ($key !== $new_var_type) {
if ($atomic_key !== $new_var_type) {
$existing_var_type->removeType($atomic_key);
$did_remove_type = true;
} else {
Expand Down

0 comments on commit a3dde47

Please sign in to comment.