phpstan-src icon indicating copy to clipboard operation
phpstan-src copied to clipboard

Fix `get_class` return type

Open VincentLanglet opened this issue 2 months ago • 2 comments

Closes https://github.com/phpstan/phpstan-src/pull/2350 Closes https://github.com/phpstan/phpstan/issues/4890

VincentLanglet avatar Oct 19 '25 17:10 VincentLanglet

I feel like a proper solution would be a new Type method. Basically the opposite of getClassStringObjectType. That one goes from class-string<Foo> to Foo.

We need to go from object Foo to class-string<Foo>.

I introduced getClassStringType(), feel free to challenge the name :)

VincentLanglet avatar Dec 06 '25 13:12 VincentLanglet

This pull request has been marked as ready for review.

phpstan-bot avatar Dec 06 '25 13:12 phpstan-bot