Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support class-string phpdoc annotation #1118

Closed
pattisahusiwa opened this issue May 4, 2020 · 5 comments
Closed

Support class-string phpdoc annotation #1118

pattisahusiwa opened this issue May 4, 2020 · 5 comments
Milestone

Comments

@pattisahusiwa
Copy link

Currently, intelephense can't recognize class-string annotation. Here sample code to demonstrate the issue.

<?php

/** @param class-string $classname */
function className(string $classname)
{
}

/** @var class-string $class */
$class = 'test';

className($class);
@KapitanOczywisty
Copy link
Contributor

There is no such type in phpdoc, afaik this is non-standard type from psalm.

@pattisahusiwa
Copy link
Author

Yes. I don't use psalm. This pseudotype is introduced by PHPStan 0.12

@bmewburn bmewburn added this to the shortlist milestone May 16, 2020
@fpesch
Copy link

fpesch commented Sep 16, 2021

any news on this?

@NorthBlue333
Copy link

NorthBlue333 commented Jun 22, 2022

Any news ? It has been 2 years now and it is documented here https://phpstan.org/writing-php-code/phpdoc-types#class-string.

@bmewburn
Copy link
Owner

bmewburn commented Jan 1, 2023

class-string support added in 1.9.0

@bmewburn bmewburn closed this as completed Jan 1, 2023
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

No branches or pull requests

5 participants