Skip to content

Supporting templates in utility types #9599

Answered by ondrejmirtes
simon-tma asked this question in Support
Discussion options

You must be logged in to vote

Hi, for this use case you need to rework your extension a bit and create LateResolvableType. Here's an example: https://github.com/phpstan/phpstan-src/blob/1.11.x/src/Type/KeyOfType.php

It makes the type resolution lazy.

It's possible you'll get some BC errors, in that case please report them here and I'll add the necessary @api.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@simon-tma
Comment options

@lipemat
Comment options

Answer selected by simon-tma
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
3 participants