Skip to content

Commit 7073da1

Browse files
committed
Cleanup
1 parent 0235c91 commit 7073da1

File tree

3 files changed

+2
-24
lines changed

3 files changed

+2
-24
lines changed

src/Psalm/Internal/Type/TypeCombiner.php

-3
Original file line numberDiff line numberDiff line change
@@ -1491,9 +1491,6 @@ private static function handleKeyedArrayEntries(
14911491
$objectlike = TKeyedArray::makeCallable(
14921492
$combination->objectlike_entries,
14931493
null,
1494-
$sealed || $fallback_key_type === null || $fallback_value_type === null
1495-
? null
1496-
: [$fallback_key_type, $fallback_value_type],
14971494
(bool)$combination->all_arrays_lists,
14981495
$from_docblock,
14991496
);

src/Psalm/Internal/Type/TypeParser.php

-4
Original file line numberDiff line numberDiff line change
@@ -1572,10 +1572,6 @@ private static function getTypeFromKeyedArrayTree(
15721572
? TKeyedArray::makeCallable(
15731573
$properties,
15741574
$class_strings,
1575-
$extra_params ?? ($sealed
1576-
? null
1577-
: [Type::getListKey(), Type::getMixed()]
1578-
),
15791575
$is_list,
15801576
$from_docblock,
15811577
) : TKeyedArray::make(

src/Psalm/Type/Atomic/TKeyedArray.php

+2-17
Original file line numberDiff line numberDiff line change
@@ -117,30 +117,15 @@ public static function make(
117117
/**
118118
* @psalm-pure
119119
* @param non-empty-array<string|int, Union> $properties
120-
* @param array{Union, Union}|null $fallback_params
121120
* @param array<string, bool> $class_strings
122121
*/
123122
public static function makeCallable(
124123
array $properties,
125124
?array $class_strings = null,
126-
?array $fallback_params = null,
127125
bool $is_list = false,
128126
bool $from_docblock = false,
129-
): self|TArray {
130-
if ($fallback_params) {
131-
$fallback_params[0] = Type::getListKey();
132-
}
133-
if (count($properties) === 1
134-
&& $properties[array_key_first($properties)]->isNever()
135-
&& ($fallback_params === null || $fallback_params[1]->isNever())
136-
) {
137-
$never = $properties[array_key_first($properties)];
138-
return new TArray([
139-
$never, $never,
140-
], $from_docblock);
141-
}
142-
143-
return new self($properties, $class_strings, $fallback_params, $is_list, true, $from_docblock);
127+
): self {
128+
return new self($properties, $class_strings, null, $is_list, true, $from_docblock);
144129
}
145130

146131
public function setIsCallable(bool $is_callable): self

0 commit comments

Comments
 (0)