mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Cleanup
This commit is contained in:
parent
c2ce7e63da
commit
79b13fab04
@ -340,9 +340,11 @@ class AssertionReconciler extends Reconciler
|
||||
}
|
||||
|
||||
if ($acceptable_atomic_types) {
|
||||
$acceptable_atomic_types = count($acceptable_atomic_types) === count($existing_var_type->getAtomicTypes())
|
||||
? $existing_var_type
|
||||
: new Union($acceptable_atomic_types);
|
||||
$acceptable_atomic_types =
|
||||
count($acceptable_atomic_types) === count($existing_var_type->getAtomicTypes())
|
||||
? $existing_var_type
|
||||
: new Union($acceptable_atomic_types)
|
||||
;
|
||||
return new Union([$new_type_part->replaceAs($acceptable_atomic_types)]);
|
||||
}
|
||||
}
|
||||
|
@ -252,7 +252,13 @@ class TypeCombiner
|
||||
if ($generic_type === 'iterable') {
|
||||
$new_types[] = new TIterable($generic_type_params);
|
||||
} else {
|
||||
$generic_object = new TGenericObject($generic_type, $generic_type_params, false, false, $combination->extra_types);
|
||||
$generic_object = new TGenericObject(
|
||||
$generic_type,
|
||||
$generic_type_params,
|
||||
false,
|
||||
false,
|
||||
$combination->extra_types
|
||||
);
|
||||
$new_types[] = $generic_object;
|
||||
|
||||
if ($combination->named_object_types) {
|
||||
|
@ -243,7 +243,10 @@ class TypeExpander
|
||||
$return_type = $return_type->replaceClassLike('self', $self_class);
|
||||
}
|
||||
if (is_string($static_class_type) || $self_class) {
|
||||
$return_type = $return_type->replaceClassLike('static', is_string($static_class_type) ? $static_class_type : $self_class);
|
||||
$return_type = $return_type->replaceClassLike(
|
||||
'static',
|
||||
is_string($static_class_type) ? $static_class_type : $self_class
|
||||
);
|
||||
}
|
||||
|
||||
if ($evaluate_class_constants && $codebase->classOrInterfaceOrEnumExists($return_type->fq_classlike_name)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user