Currently SA tools such as Psalm and PHPStan both use relatively complex annotations such as: @var (FILTER_VALIDATE_*)|(FILTER_SANITIZE_*)|null, Class:*... All accidentally caused LSP to resolve the type to mixed and ignore the native type declared in the function signature.
@var (FILTER_VALIDATE_*)|(FILTER_SANITIZE_*)|null
Class:*
mixed
probably most of them are listed here: https://psalm.dev/docs/annotating_code/type_syntax/scalar_types/
So far, we (at least) understand the syntax.
(1) Next, we need to filter the completion list. (2) Then to improve code analysis, to check against specific constants.