Skip to content

Support psalm's class-string-map<T of Foo, T> utility type#306

Open
lacatoire wants to merge 3 commits intophpDocumentor:2.xfrom
lacatoire:feat/class-string-map
Open

Support psalm's class-string-map<T of Foo, T> utility type#306
lacatoire wants to merge 3 commits intophpDocumentor:2.xfrom
lacatoire:feat/class-string-map

Conversation

@lacatoire
Copy link
Copy Markdown

Rewrites class-string-map<T of Foo, T> into the equivalent array<class-string<Foo>, <value-with-T-substituted>> before passing the input to the underlying phpstan parser (which otherwise chokes on the T of Foo template binding syntax). Nested occurrences are expanded from the innermost outwards; union/nullable value expressions are preserved.

Fixes #266

Rewrites `class-string-map<T of Foo, T>` into `array<class-string<Foo>, <value-with-T-substituted>>` before passing the input to the phpstan parser (which otherwise chokes on the `T of Foo` template binding syntax). Nested occurrences are expanded from the innermost outwards.

Fixes phpDocumentor#266
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support class-string-map<T of Foo, T>

1 participant