Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Dec 19, 2023
1 parent 9b82514 commit 456a5cd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function analyze(
NodeDataProvider $type_provider,
?Context $global_context = null,
bool $add_mutations = false,
array &$byref_vars = []
array &$byref_vars = [],
): ?bool {
$storage = $this->storage;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Internal/Type/Comparator/ArrayTypeComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static function isContainedBy(
&& !$container_type_part->isNonEmpty()
&& !$container_type_part->isSealed()
&& $input_type_part->equals(
$container_type_part->getGenericArrayType($container_type_part->isNonEmpty()),
$container_type_part->getGenericArrayType(),
false,
)
) {
Expand Down
4 changes: 2 additions & 2 deletions src/Psalm/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ public static function intersectUnionTypes(
?Union $type_2,
Codebase $codebase,
bool $allow_interface_equality = false,
bool $allow_float_int_equality = true
bool $allow_float_int_equality = true,
): ?Union {
if ($type_2 === null && $type_1 === null) {
throw new UnexpectedValueException('At least one type must be provided to combine');
Expand Down Expand Up @@ -846,7 +846,7 @@ private static function intersectAtomicTypes(
Codebase $codebase,
bool &$intersection_performed,
bool $allow_interface_equality = false,
bool $allow_float_int_equality = true
bool $allow_float_int_equality = true,
): ?Atomic {
$intersection_atomic = null;
$wider_type = null;
Expand Down
6 changes: 1 addition & 5 deletions src/Psalm/Type/Reconciler.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
use Psalm\Type\Atomic\TFalse;
use Psalm\Type\Atomic\TInt;
use Psalm\Type\Atomic\TKeyedArray;
use Psalm\Type\Atomic\TList;
use Psalm\Type\Atomic\TLiteralInt;
use Psalm\Type\Atomic\TLiteralString;
use Psalm\Type\Atomic\TMixed;
Expand Down Expand Up @@ -1152,11 +1151,8 @@ private static function adjustTKeyedArrayType(
);

foreach ($array_key_offsets as $array_key_offset) {
if (isset($existing_types[$base_key]) && $array_key_offset !== false) {
if (isset($existing_types[$base_key])) {
foreach ($existing_types[$base_key]->getAtomicTypes() as $base_atomic_type) {
if ($base_atomic_type instanceof TList) {
$base_atomic_type = $base_atomic_type->getKeyedArray();
}
if ($base_atomic_type instanceof TKeyedArray
|| ($base_atomic_type instanceof TArray
&& !$base_atomic_type->isEmptyArray())
Expand Down

0 comments on commit 456a5cd

Please sign in to comment.