1

I'm currently trying to fix the annotations of a function of my project that looks like this :

https://psalm.dev/r/7b974e8822

However, it always refuse something like A::class . '[]' as a class-string and would like only a string. But doing so I lose my type hint. How should I do it ?

I actually don't know if I missed something in Psalm documentation or if I should open an issue to support it. I'm have to use this because of symfony serializer. I know I can still force it, but I would like to find the way to make it work in a proper way. Psalm support in phpdoc B[] so I see no reason to not support it as a param value.

MinDBreaK
  • 153
  • 2
  • 16
  • `"B[]"` is not a class-string for sure, e.g. you can't use it with `new`. It may be seen as a kind of *type string* but it's not a concept Psalm has. – weirdan Mar 20 '21 at 23:07
  • Yes of course, I understand that, but is there a way I can make it understand this ? In this example I used a new, but in my project this is actually handled by the Symfony Serializer – MinDBreaK Mar 22 '21 at 08:38
  • I don't think you can, not currently anyway. – weirdan Mar 23 '21 at 10:20
  • Thx, I'll open an issue then, see if they can support it – MinDBreaK Mar 24 '21 at 16:53

0 Answers0