vscode-intelephense icon indicating copy to clipboard operation
vscode-intelephense copied to clipboard

Support class-string phpdoc annotation

Open pattisahusiwa opened this issue 5 years ago • 4 comments

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);

pattisahusiwa avatar May 04 '20 19:05 pattisahusiwa

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

KapitanOczywisty avatar May 04 '20 20:05 KapitanOczywisty

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

pattisahusiwa avatar May 04 '20 20:05 pattisahusiwa

any news on this?

fpesch avatar Sep 16 '21 18:09 fpesch

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

NorthBlue333 avatar Jun 22 '22 13:06 NorthBlue333

class-string support added in 1.9.0

bmewburn avatar Jan 01 '23 20:01 bmewburn