1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Remove now-unnecessary code

Originally added in 8bc17e47bec0ae89429cd35442f9d2ca61053201
This commit is contained in:
Matthew Brown 2022-01-05 01:54:00 +00:00
parent 7595a3c579
commit f5d6d2380f

View File

@ -508,7 +508,6 @@ class AssertionReconciler extends Reconciler
$codebase,
$existing_var_type,
$new_type,
$template_type_map,
$any_scalar_type_match_found
);
@ -586,7 +585,6 @@ class AssertionReconciler extends Reconciler
Codebase $codebase,
Union $existing_type,
Union $new_type,
array $template_type_map,
bool &$any_scalar_type_match_found = false
): ?Union {
$matching_atomic_types = [];
@ -599,7 +597,6 @@ class AssertionReconciler extends Reconciler
$existing_type_part,
$new_type_part,
$codebase,
$template_type_map,
$any_scalar_type_match_found
);
@ -617,14 +614,10 @@ class AssertionReconciler extends Reconciler
return null;
}
/**
* @param array<string, array<string, Union>> $template_type_map
*/
private static function filterAtomicWithAnother(
Atomic $type_1_atomic,
Atomic $type_2_atomic,
Codebase $codebase,
array $template_type_map,
bool &$any_scalar_type_match_found
): ?Atomic {
if ($type_1_atomic instanceof TFloat
@ -654,7 +647,6 @@ class AssertionReconciler extends Reconciler
$type_1_atomic,
$type_2_atomic,
$codebase,
$template_type_map,
$atomic_comparison_results->type_coerced ?? false
);
}
@ -675,7 +667,6 @@ class AssertionReconciler extends Reconciler
$type_2_atomic,
$type_1_atomic,
$codebase,
$template_type_map,
$atomic_comparison_results->type_coerced ?? false
);
}
@ -704,7 +695,6 @@ class AssertionReconciler extends Reconciler
$codebase,
$type_1_atomic->type_param,
$type_2_value,
$template_type_map,
$any_scalar_type_match_found
);
@ -730,7 +720,6 @@ class AssertionReconciler extends Reconciler
$codebase,
$type_2_atomic->type_param,
$type_1_value,
$template_type_map,
$any_scalar_type_match_found
);
@ -778,7 +767,6 @@ class AssertionReconciler extends Reconciler
$codebase,
$type_1_param,
$type_2_param,
$template_type_map,
$any_scalar_type_match_found
);
@ -786,14 +774,6 @@ class AssertionReconciler extends Reconciler
return null;
}
if ($template_type_map) {
TemplateInferredTypeReplacer::replace(
$type_2_param,
new TemplateResult([], $template_type_map),
$codebase
);
}
if ($type_1_atomic->type_params[$i]->getId() !== $type_2_param_id) {
/** @psalm-suppress PropertyTypeCoercion */
$type_1_atomic->type_params[$i] = $type_2_param;
@ -816,7 +796,6 @@ class AssertionReconciler extends Reconciler
$codebase,
$type_1_param,
$type_2_param,
$template_type_map,
$any_scalar_type_match_found
);
@ -824,14 +803,6 @@ class AssertionReconciler extends Reconciler
return null;
}
if ($template_type_map) {
TemplateInferredTypeReplacer::replace(
$type_2_param,
new TemplateResult([], $template_type_map),
$codebase
);
}
if ($type_1_atomic->type_param->getId() !== $type_2_param->getId()) {
$type_1_atomic->type_param = $type_2_param;
}
@ -851,7 +822,6 @@ class AssertionReconciler extends Reconciler
$codebase,
$type_1_param,
$type_2_param,
$template_type_map,
$any_scalar_type_match_found
);
@ -859,14 +829,6 @@ class AssertionReconciler extends Reconciler
return null;
}
if ($template_type_map) {
TemplateInferredTypeReplacer::replace(
$type_2_param,
new TemplateResult([], $template_type_map),
$codebase
);
}
if ($type_1_atomic->properties[$property_key]->getId() !== $type_2_param->getId()) {
$type_1_atomic->properties[$property_key] = $type_2_param;
}
@ -910,14 +872,10 @@ class AssertionReconciler extends Reconciler
return $matching_atomic_type;
}
/**
* @param array<string, array<string, Union>> $template_type_map
*/
private static function refineContainedAtomicWithAnother(
Atomic $type_1_atomic,
Atomic $type_2_atomic,
Codebase $codebase,
array $template_type_map,
bool $type_coerced
): ?Atomic {
if ($type_coerced
@ -937,8 +895,7 @@ class AssertionReconciler extends Reconciler
$type_1_as = self::filterTypeWithAnother(
$codebase,
$type_1_atomic->as,
new Union([$type_2_atomic]),
$template_type_map
new Union([$type_2_atomic])
);
if ($type_1_as === null) {