PhpEnums
PhpEnums copied to clipboard
Incorrect use of templated parameters for static functions in templated interfaces
Example: https://psalm.dev/r/a2b077f2e5 Comment of @weirdan: https://github.com/vimeo/psalm/issues/2571#issuecomment-572011683
Hmm, so we need to add the @template T of int|string
line to each static methods, but using the same template name (T
) would generate a "Duplicate template param T in docblock for EnumInterface::get" so we need to use another name… this is a bit annoying :/
I think we don't need templates in static methods
i guess this is the cause of this psalm error:
Argument 1 of USState::accepts expects Elao\Enum\T, string provided