Skip to content

Commit

Permalink
Check for the existance of the 'mixed' key to detect untyped parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
robchett committed Apr 20, 2023
1 parent 0a40286 commit 9af8e41
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Psalm/Type/UnionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -800,11 +800,13 @@ public function isMixed(bool $check_templates = false): bool
return count(
array_filter(
$this->types,
static fn($type): bool => $type instanceof TMixed
static fn($type, $key): bool => $key == 'mixed'
|| $type instanceof TMixed
|| ($check_templates
&& $type instanceof TTemplateParam
&& $type->as->isMixed()
)
, ARRAY_FILTER_USE_BOTH
),
) === count($this->types);
}
Expand Down

0 comments on commit 9af8e41

Please sign in to comment.