ging-dev <?php class A { const STATUS_FOO = 'foo'; const STATUS_BAR = 'bar'; } /** * @param A::STATUS_* $s */ function foo(string $s) : string { switch ($s) { case A::STATUS_FOO: return 'hello'; default: // any other status return 'goodbye'; } } $s must resolve as string, also regular class constants is not solved correctly https://psalm.dev/docs/annotating_code/type_syntax/value_types/#regular-class-constants
JakubMisek ging-dev thank you for the suggestion. Confirming, we don't support class constants, literals, or asterisks in PHPDoc type hints yet.